Index: initrd/admin-tclkit/kitcreator-modules/system/system.c ================================================================== --- initrd/admin-tclkit/kitcreator-modules/system/system.c +++ initrd/admin-tclkit/kitcreator-modules/system/system.c @@ -1888,11 +1888,11 @@ time_t currtime; char *argv[3], *envv[512]; char *logfile, *filename, *cwd, *user, *group; char logmsg[2048]; fd_set read_fdset; - int pipe_ret, setsid_ret, execve_ret, tcl_ret, select_ret; + int pipe_ret, setsid_ret, execve_ret, tcl_ret, select_ret, chdir_ret; int null_fd, log_fd, tmp_fd, max_fd; int env_entry_objc; int fds[2], fd; int status; int idx; @@ -2029,11 +2029,16 @@ /* 6. Setup environment */ /* 6.a. Set umask */ umask(umask_val); /* 6.b. Set working directory */ - chdir(cwd); + chdir_ret = chdir(cwd); + if (chdir_ret != 0) { + write(fd, &child_pgid, sizeof(child_pgid)); + + _exit(0); + } /* 6.c. Open log file for stderr and stdout */ log_fd = open(logfile, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); /* 6.d. Open "/dev/null" for stdin */