diff options
| author | Paul Eggert | 2016-11-06 22:55:30 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-11-06 22:56:36 -0800 |
| commit | b6d9613df83813609ef80da45975e70954d1fb6d (patch) | |
| tree | bf05ac8bbd5a91b40fb23a8d84dce66360884211 /src/callproc.c | |
| parent | f1d19d1445a8e7d4ee0d13edb8ed99e222603086 (diff) | |
| download | emacs-b6d9613df83813609ef80da45975e70954d1fb6d.tar.gz emacs-b6d9613df83813609ef80da45975e70954d1fb6d.zip | |
Restore file descriptor limit in subprocesses
Problem reported by Philipp Stephani (Bug#24869).
* src/callproc.c (child_setup) [!DOS_NT]:
Call restore_nofile_limit in the child.
* src/process.c (nofile_limit) [HAVE_SETRLIMIT]: New static var.
(restore_nofile_limit): New function.
(init_process_emacs) [HAVE_SETRLIMIT]: Set the new var.
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/callproc.c b/src/callproc.c index 8ed28556e0d..dc3ca4ac102 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -1315,6 +1315,9 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp, | |||
| 1315 | #else /* not WINDOWSNT */ | 1315 | #else /* not WINDOWSNT */ |
| 1316 | 1316 | ||
| 1317 | #ifndef MSDOS | 1317 | #ifndef MSDOS |
| 1318 | |||
| 1319 | restore_nofile_limit (); | ||
| 1320 | |||
| 1318 | /* Redirect file descriptors and clear the close-on-exec flag on the | 1321 | /* Redirect file descriptors and clear the close-on-exec flag on the |
| 1319 | redirected ones. IN, OUT, and ERR are close-on-exec so they | 1322 | redirected ones. IN, OUT, and ERR are close-on-exec so they |
| 1320 | need not be closed explicitly. */ | 1323 | need not be closed explicitly. */ |