Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 124102 Details for
Bug 182721
gpm does not start and prevents local from starting with baselayout-2
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Close stdin/out/err when daemonising
gpm-daemon.patch (text/plain), 1.62 KB, created by
Roy Marples (RETIRED)
on 2007-07-06 23:13:48 UTC
(
hide
)
Description:
Close stdin/out/err when daemonising
Filename:
MIME Type:
Creator:
Roy Marples (RETIRED)
Created:
2007-07-06 23:13:48 UTC
Size:
1.62 KB
patch
obsolete
>diff -ur a/src/startup.c b/src/startup.c >--- a/src/startup.c 2002-12-24 22:57:16.000000000 +0000 >+++ b/src/startup.c 2007-07-06 23:33:50.000000000 +0100 >@@ -29,7 +29,7 @@ > #include <sys/types.h> /* geteuid, mknod */ > #include <sys/stat.h> /* mknod */ > #include <fcntl.h> /* mknod */ >-#include <unistd.h> /* mknod */ >+#include <unistd.h> /* mknod, daemon */ > > > #include "headers/gpmInt.h" >@@ -134,26 +134,17 @@ > } > } > >- if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ >- /* goto background and become a session leader (Stefan Giessler) */ >- switch(fork()) { >- case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ >- case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ >- default: _exit(0); /* parent */ >- } >+ if (option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ >+ if (daemon(0,0)) >+ gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ > >- if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); >+ option.run_status = GPM_RUN_DAEMON; /* child */ > } > > /* damon init: check whether we run or not, display message */ > check_uniqueness(); > gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); > >- /* is changing to root needed, because of relative paths ? or can we just >- * remove and ignore it ?? FIXME */ >- if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED); >- >- > //return mouse_table[1].fd; /* the second is handled in the main() */ > > /****************** OLD CODE from gpn.c END ***********************/
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 182721
:
122670
|
123185
| 124102