Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
--- 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

This comment has been minimized.

Copy link
Owner Author

commented Oct 27, 2010

@peterhost

This comment has been minimized.

Copy link
Owner Author

commented Oct 27, 2010

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
You can’t perform that action at this time.