11b8ab3f77
kernel
27 lines
1.2 KiB
Diff
27 lines
1.2 KiB
Diff
--- gpm-1.20.1/src/prog/gpm-root.y.openmax 2002-12-24 23:57:16.000000000 +0100
|
|
+++ gpm-1.20.1/src/prog/gpm-root.y 2007-07-24 20:45:46.000000000 +0200
|
|
@@ -525,7 +525,9 @@
|
|
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;
|
|
--- gpm-1.20.1/src/special.c.openmax 2007-07-24 20:45:46.000000000 +0200
|
|
+++ gpm-1.20.1/src/special.c 2007-07-24 20:45:46.000000000 +0200
|
|
@@ -156,7 +156,9 @@
|
|
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 */
|
|
|