if (verbose > 2)
rprintf(FINFO,"get_local_name count=%d %s\n",
- flist->count, name);
+ flist->count, NS(name));
+
+ if (!name)
+ return NULL;
if (do_stat(name,&st) == 0) {
if (S_ISDIR(st.st_mode)) {
if (flist->count == 1)
return name;
- if (!name)
- return NULL;
-
if (do_mkdir(name,0777 & ~orig_umask) != 0) {
rprintf(FERROR,"mkdir %s : %s (1)\n",name,strerror(errno));
exit_cleanup(RERR_FILEIO);
carried across */
orig_umask = (int)umask(0);
- if (!parse_arguments(argc, argv)) {
+ if (!parse_arguments(argc, argv, 1)) {
exit_cleanup(RERR_SYNTAX);
}
signal(SIGHUP,SIGNAL_CAST sig_int);
signal(SIGTERM,SIGNAL_CAST sig_int);
+ /* Initialize push_dir here because on some old systems getcwd
+ (implemented by forking "pwd" and reading its output) doesn't
+ work when there are other child processes. Also, on all systems
+ that implement getcwd that way "pwd" can't be found after chroot. */
+ push_dir(NULL,0);
+
if (am_daemon) {
return daemon_main();
}