Lines 156-162
Link Here
|
156 |
open(GPM_NULL_DEV,O_RDONLY); /* stdin */ |
156 |
open(GPM_NULL_DEV,O_RDONLY); /* stdin */ |
157 |
open(console.device, O_WRONLY); /* stdout */ |
157 |
open(console.device, O_WRONLY); /* stdout */ |
158 |
dup(1); /* stderr */ |
158 |
dup(1); /* stderr */ |
159 |
for (i=3;i<OPEN_MAX; i++) close(i); |
159 |
int open_max = sysconf(_SC_OPEN_MAX); |
|
|
160 |
if (open_max == -1) open_max = 1024; |
161 |
for (i=3;i<open_max; i++) close(i); |
160 |
execl("/bin/sh","sh","-c",command,(char *)NULL); |
162 |
execl("/bin/sh","sh","-c",command,(char *)NULL); |
161 |
exit(1); /* shouldn't happen */ |
163 |
exit(1); /* shouldn't happen */ |