diff options
author | Chris Larson <clarson@kergoth.com> | 2004-12-09 09:47:41 +0000 |
---|---|---|
committer | Chris Larson <clarson@kergoth.com> | 2004-12-09 09:47:41 +0000 |
commit | 2c5b8ec6d95cf68650265941530e5ce38c8dd6d9 (patch) | |
tree | bf879bea7ef8517ba8c3d1286ef300401d3d484c /qte/qte-2.3.7/daemonize.patch | |
parent | 101e2f1623def0a355d20aacb8bd93810703e834 (diff) |
Merge oe-devel@oe-devel.bkbits.net:openembedded
into hyperion.kergoth.com:/home/kergoth/code/openembedded
2004/12/09 03:39:39-06:00 kergoth.com!kergoth
Break people's builds again.. this time moving the packages into a packages/ subdir to clean things up a bit.
BKrev: 41b81f3dvlp3rU7_8MUXLcI8LDdDoA
Diffstat (limited to 'qte/qte-2.3.7/daemonize.patch')
-rw-r--r-- | qte/qte-2.3.7/daemonize.patch | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/qte/qte-2.3.7/daemonize.patch b/qte/qte-2.3.7/daemonize.patch deleted file mode 100644 index 1f83398988..0000000000 --- a/qte/qte-2.3.7/daemonize.patch +++ /dev/null @@ -1,113 +0,0 @@ - -# -# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher -# - ---- qt-2.3.7/src/kernel/qapplication_qws.cpp~daemonize 2004-07-17 22:47:54.840820000 +0200 -+++ qt-2.3.7/src/kernel/qapplication_qws.cpp 2004-07-17 23:34:32.407525912 +0200 -@@ -103,6 +103,7 @@ - #endif - - #include <sys/time.h> -+#include <syslog.h> - - #if defined(_OS_AIX_) && defined(_CC_GNU_) - #include <sys/select.h> -@@ -162,6 +163,7 @@ - //these used to be environment variables, they are initialized from - //environment variables in - -+bool qws_daemon = TRUE; - bool qws_savefonts = FALSE; - bool qws_screen_is_interlaced=FALSE; //### should be detected - bool qws_shared_memory = FALSE; -@@ -1614,6 +1616,10 @@ - mwGeometry = argv[i]; - } else if ( arg == "-shared" ) { - qws_shared_memory = TRUE; -+ } else if ( arg == "-daemon" ) { -+ qws_daemon = TRUE; -+ } else if ( arg == "-nodaemon" ) { -+ qws_daemon = FALSE; - } else if ( arg == "-noshared" ) { - qws_shared_memory = FALSE; - } else if ( arg == "-savefonts" ) { -@@ -1670,6 +1676,78 @@ - qt_appType = type; - qws_single_process = TRUE; - -+ /* Daemonize the server process -- (C) Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> -+ * Added a new command line option which only is relevant if the application is created as a GuiServer. -+ * The option is -daemon respectively -nodaemon. If in daemon mode (which is the default now), the -+ * server will detach from the controlling terminal and continue as a daemon. This is done via the standard -+ * UNIX double fork magic. -+ */ -+ if ( qws_daemon ) -+ { -+ qWarning( "qt_init() - starting in daemon mode..." ); -+ -+ int pid1 = fork(); -+ if ( pid1 == -1 ) -+ { -+ qWarning( "qt_init() - can't perform initial fork: %s", strerror( errno ) ); -+ exit( -1 ); -+ } -+ if ( pid1 ) _exit( 0 ); // ok, first fork performed -+ -+ chdir( "/" ); -+ setsid(); -+ umask(0); -+ close(0); -+ close(1); -+ close(2); -+ -+ int fdnull = ::open( "/dev/null", O_RDWR ); -+ if ( fdnull == -1 ) -+ { -+ syslog( 3, "qt_init() - can't open /dev/null to redirect std{in|out|err}: %s", strerror( errno ) ); -+ exit( -1 ); -+ } -+ dup2( fdnull, 0 ); // stdin -+ dup2( fdnull, 1 ); // stdout -+ dup2( fdnull, 2 ); // stderr -+ -+ int pid2 = fork(); -+ if ( pid2 == -1 ) -+ { -+ syslog( 3, "qt_init() - can't perform initial fork: %s", strerror( errno ) ); -+ exit( -1 ); -+ } -+ if ( pid2 ) -+ { -+ syslog( 4, "qt_init() [%d] - successfully entered daemon mode", pid2 ); -+ _exit( 0 ); // ok, second fork performed -+ } -+ } -+ -+ /* -+ * , , -+ * /( )` -+ * \ \___ / | B E W A R E ! -+ * /- _ `-/ ' We are a DAEMON now! -+ * (/\/ \ \ /\ -+ * / / | ` \ -+ * O O ) / | -+ * `-^--'`< ' -+ * (_.) _ ) / -+ * `.___/` / -+ * `-----' / -+ * <----. __ / __ \ -+ * <----|====O)))==) \) /==== -+ * <----' `--' `.__,' \ -+ * | | -+ * \ / -+ * ______( (_ / \______ -+ * (FL) ,' ,-----' | \ -+ * `--{__________) \/ -+ * -+ */ -+ -+ - /* Allocate a dedicated virtual terminal -- (C) Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> - * Added a new command line option which only is relevant if the application is created as a GuiServer. - * The option is -terminal <num>, where <num> specifies the virtual terminal to be occupied by the server. |