]> git.saurik.com Git - apple/shell_cmds.git/blobdiff - nohup/nohup.c
shell_cmds-203.tar.gz
[apple/shell_cmds.git] / nohup / nohup.c
index cea00b77e400005a1acd0666b396881537d6f532..f77dce52828e34a6650bcb716531e0092a8619c9 100644 (file)
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD: src/usr.bin/nohup/nohup.c,v 1.10 2003/05/03 19:44:46 obrien
 #include <unistd.h>
 
 #ifdef __APPLE__
+#include <TargetConditionals.h>
 #include <vproc.h>
 #include <vproc_priv.h>
 #endif
@@ -94,9 +95,9 @@ main(int argc, char *argv[])
 
        (void)signal(SIGHUP, SIG_IGN);
 
-#ifdef __APPLE__
-       if (_vprocmgr_move_subset_to_user(geteuid(), "Background") != NULL)
-               err(EXIT_MISC, "can't migrate to background session");
+#if defined(__APPLE__) && !TARGET_OS_EMBEDDED
+       if (_vprocmgr_detach_from_console(0) != NULL)
+               err(EXIT_MISC, "can't detach from console");
 #endif
        execvp(*argv, argv);
        exit_status = (errno == ENOENT) ? EXIT_NOTFOUND : EXIT_NOEXEC;