Ticket #20862: patch-screen.diff
File patch-screen.diff, 3.7 KB (added by raimue (Rainer Müller), 15 years ago) |
---|
-
files/patch-process.c
1 diff -r -u screen-4.0.3.orig/process.c screen-4.0.3/process.c 2 --- process.c 2008-07-06 23:40:16.000000000 -0700 3 +++ process.c 2008-07-06 23:47:55.000000000 -0700 4 @@ -5466,7 +5466,7 @@ 5 *buf = 0; 6 return; 7 } 8 - act.nr = (int)data; 9 + act.nr = (int)(intptr_t)data; 10 act.args = noargs; 11 act.argl = 0; 12 DoAction(&act, -1); 13 -
files/patch-screen.c
Property changes on: files/patch-process.c ___________________________________________________________________ Added: svn:eol-style + native
1 --- screen.c .orig 2009-01-21 12:06:11.000000000 +08002 +++ screen.c 2009-01-21 12:08:27.000000000 +08001 --- screen.c 2003-09-08 07:26:41.000000000 -0700 2 +++ screen.c 2009-02-13 12:05:05.000000000 -0800 3 3 @@ -101,6 +101,11 @@ 4 4 5 #include "logfile.h" 5 #include "logfile.h" /* islogfile, logfflush */ 6 6 7 7 +#ifdef __APPLE__ 8 8 +#include <vproc.h> 9 +#include "vproc_priv.h"9 +#include <vproc_priv.h> 10 10 +#endif 11 11 + 12 12 #ifdef DEBUG 13 13 FILE *dfp; 14 14 #endif 15 @@ -1211,6 +1216,11 @@ 15 @@ -929,6 +934,16 @@ 16 Panic(0, "No $SCREENDIR with multi screens, please."); 17 #endif 18 } 19 +#ifdef __APPLE__ 20 + else if (!multi && real_uid == eff_uid) { 21 + static char DarwinSockDir[PATH_MAX]; 22 + if (confstr(_CS_DARWIN_USER_TEMP_DIR, DarwinSockDir, sizeof(DarwinSockDir))) { 23 + strlcat(DarwinSockDir, ".screen", sizeof(DarwinSockDir)); 24 + SockDir = DarwinSockDir; 25 + } 26 + } 27 +#endif /* __APPLE__ */ 28 + 29 #ifdef MULTIUSER 30 if (multiattach) 31 { 32 @@ -1211,6 +1226,11 @@ 16 33 freopen("/dev/null", "w", stderr); 17 34 debug("-- screen.back debug started\n"); 18 35 19 36 +#ifdef __APPLE__ 20 + if (_vprocmgr_move_subset_to_user(real_uid, "Background") != NULL)21 + errx(1, "can't migrate to background session");37 + if (_vprocmgr_detach_from_console(0) != NULL) 38 + errx(1, "can't detach from console"); 22 39 +#endif 23 40 + 24 41 /* 25 42 * This guarantees that the session owner is listed, even when we 26 43 * start detached. From now on we should not refer to 'LoginName' 44 -
Portfile
67 67 patchfiles-append patch-Makefile.in patch-config.h.in patch-configure patch-pty.c patch-window.c patch-screen.c 68 68 } 69 69 70 platform darwin 10 { 71 # post-patch { 72 # reinplace s|^deflogin|#deflogin| ${workpath}/${distname}/etc/etcscreenrc 73 # } 74 75 # These patches are based on http://www.opensource.apple.com/source/screen/screen-16/patches/ 76 # The vproc_priv.h is the private header from launchd, used in Apple's 10.6 screen patches 77 # We copied the header file from http://launchd.macosforge.org/trac/browser/trunk/launchd/src/vproc_priv.h, r23776 78 master_sites-append http://www.cis.nctu.edu.tw/~is85005/dports/screen/r23776/:launchd_priv_header 79 distfiles-append vproc_priv.h:launchd_priv_header 80 checksums-append vproc_priv.h md5 50800817fa688e7e6ae379cd599f15ca 81 post-extract { file copy ${distpath}/vproc_priv.h ${workpath}/${distname} } 82 patchfiles-append patch-Makefile.in patch-config.h.in patch-configure patch-pty.c patch-window.c patch-screen.c patch-process.c 83 } 84 70 85 post-install { 71 86 ui_msg "===============================================================================\n" 72 87 ui_msg "Any screens running before upgrading, will not be available, post-install.\n"