Someone on OS X 10.5 or above able to build tmux from Git with this and
tell me if:

a) it compiles without any new warnings;

b) tmux still runs;

c) it allows them to get rid of reattach-to-user-namespace.


diff --git a/compat/daemon.c b/compat/daemon.c
index 678d78ef..ddeff02f 100644
--- a/compat/daemon.c
+++ b/compat/daemon.c
@@ -28,8 +28,15 @@
  * SUCH DAMAGE.
  */
 
+#include <sys/types.h>
+
+#ifdef __APPLE__
+#include <Availability.h>
+#endif
+
 #include <fcntl.h>
 #include <unistd.h>
+#include <stdint.h>
 #include <stdlib.h>
 
 #include "compat.h"
@@ -61,5 +68,13 @@ daemon(int nochdir, int noclose)
                if (fd > 2)
                        (void)close (fd);
        }
+
+#ifdef __MAC_10_6 /* and above */
+       extern void *_vprocmgr_move_subset_to_user(uid_t, const char *, 
uint64_t);
+       __vprocmgr_move_subset_to_user(getuid(), "Background", 0);
+#elifdef __MAC_10_5
+       extern void *_vprocmgr_move_subset_to_user(uid_t, const char *);
+       __vprocmgr_move_subset_to_user(getuid(), "Background");
+#endif
        return (0);
 }
diff --git a/configure.ac b/configure.ac
index dcf62ab9..45701b95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -569,8 +569,14 @@ case "$host_os" in
                ;;
        *darwin*)
                AC_MSG_RESULT(darwin)
-               AC_DEFINE(BROKEN_CMSG_FIRSTHDR)
                PLATFORM=darwin
+               #
+               # OS X CMSG_FIRSTHDR is broken, so redefine it with a working
+               # one. daemon works but has some stupid side effects, so use
+               # our internal version which has a workaround.
+               #
+               AC_DEFINE(BROKEN_CMSG_FIRSTHDR)
+               AC_LIBOBJ(daemon)
                ;;
        *dragonfly*)
                AC_MSG_RESULT(dragonfly)

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to