Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 133735 Details for
Bug 195977
sys-libs/gpm-1.20.1-r6 fails to build w/ linux-headers-2.6.23 due to missing "OPEN_MAX"
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
gpm "OPEN_MAX" patch
open_max.patch (text/plain), 1.48 KB, created by
teidakankan
on 2007-10-18 04:37:46 UTC
(
hide
)
Description:
gpm "OPEN_MAX" patch
Filename:
MIME Type:
Creator:
teidakankan
Created:
2007-10-18 04:37:46 UTC
Size:
1.48 KB
patch
obsolete
>Daemons should always close stdin, stdout and stderr after forking otherwise >the controlling terminal will have issues closing. >Examples include starting over ssh or baselayout-2 >http://bugs.gentoo.org/show_bug.cgi?id=182721 > > >diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y >index 3a97602..b496550 100644 >--- a/src/prog/gpm-root.y >+++ b/src/prog/gpm-root.y >@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) > open("/dev/null",O_RDONLY); /* stdin */ > open(consolename,O_WRONLY); /* stdout */ > dup(1); /* stderr */ >- for (i=3;i<OPEN_MAX; i++) close(i); >+ int open_max = sysconf(_SC_OPEN_MAX); >+ if (open_max == -1) open_max = 1024; >+ for (i=3;i<open_max; i++) close(i); > execl("/bin/sh","sh","-c",self->arg,(char *)NULL); > exit(1); /* shouldn't happen */ > default: return 0; >diff --git a/src/special.c b/src/special.c >index 5bed91a..c6cd04d 100644 >--- a/src/special.c >+++ b/src/special.c >@@ -156,7 +156,9 @@ int processSpecial(Gpm_Event *event) > open(GPM_NULL_DEV,O_RDONLY); /* stdin */ > open(console.device, O_WRONLY); /* stdout */ > dup(1); /* stderr */ >- for (i=3;i<OPEN_MAX; i++) close(i); >+ int open_max = sysconf(_SC_OPEN_MAX); >+ if (open_max == -1) open_max = 1024; >+ for (i=3;i<open_max; i++) close(i); > execl("/bin/sh","sh","-c",command,(char *)NULL); > exit(1); /* shouldn't happen */
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 Raw
Actions:
View
Attachments on
bug 195977
:
133591
| 133735 |
133736
|
133737
|
134554