Skip to content

Instantly share code, notes, and snippets.

@peterhost
Created October 27, 2010 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterhost/649710 to your computer and use it in GitHub Desktop.
Save peterhost/649710 to your computer and use it in GitHub Desktop.
--- screen.c.orig 2009-01-21 12:06:11.000000000 +0800
+++ screen.c 2009-01-21 12:08:27.000000000 +0800
@@ -101,6 +101,11 @@
#include "logfile.h" /* islogfile, logfflush */
+#ifdef __APPLE__
+#include <vproc.h>
+#include "vproc_priv.h"
+#endif
+
#ifdef DEBUG
FILE *dfp;
#endif
@@ -1211,6 +1216,11 @@
freopen("/dev/null", "w", stderr);
debug("-- screen.back debug started\n");
+#ifdef __APPLE__
+ if (_vprocmgr_move_subset_to_user(real_uid, "Background", 0) != NULL)
+ errx(1, "can't migrate to background session");
+#endif
+
/*
* This guarantees that the session owner is listed, even when we
* start detached. From now on we should not refer to 'LoginName'
@peterhost
Copy link
Author

@peterhost
Copy link
Author

make chokes on the _vprocmgr_move_subset_to_user function (source here http://www.opensource.apple.com/source/launchd/launchd-329.3/launchd/src/vproc_priv.h) which needs 3 arguments.
I just added 0 for the 'uint64_t flags' argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment