mirror of
https://github.com/uselessd/alcove.git
synced 2026-04-15 09:15:19 +00:00
Correct type returned by sysconf
At least on Linux, sysconf(_SC_OPEN_MAX) returns the correct value if the setrlimit has been used to raise the current limit for file descriptors.
This commit is contained in:
@@ -255,7 +255,7 @@ alcove_child_fun(void *arg)
|
||||
alcove_arg_t *child_arg = arg;
|
||||
alcove_state_t *ap = child_arg->ap;
|
||||
alcove_fd_t *fd = child_arg->fd;
|
||||
int maxfd = sysconf(_SC_OPEN_MAX);
|
||||
long maxfd = sysconf(_SC_OPEN_MAX);
|
||||
int n = 0;
|
||||
|
||||
if ( (close(fd->in[PIPE_WRITE]) < 0)
|
||||
@@ -268,9 +268,7 @@ alcove_child_fun(void *arg)
|
||||
|| (dup2(fd->err[PIPE_WRITE], STDERR_FILENO) < 0))
|
||||
return -1;
|
||||
|
||||
/* Close all other fd's inherited from the parent.
|
||||
* XXX parent may have raised maxfd using setrlimit
|
||||
*/
|
||||
/* Close all other fd's inherited from the parent. */
|
||||
for (n = 0; n < maxfd; n++) {
|
||||
if ( (n != STDIN_FILENO)
|
||||
&& (n != STDOUT_FILENO)
|
||||
|
||||
Reference in New Issue
Block a user