X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fcallproc.c;h=9b39b48c7e3dc269dbf004570012566ef76609de;hb=866755fc150ad8fbfdce8a242e60ba4b0b95563f;hp=ff28a498243fda0756cc74aec8a7a7e0662fcebe;hpb=21db8709c0c2dcedbd278c7fe571290d5ce80a71;p=chise%2Fxemacs-chise.git.1 diff --git a/src/callproc.c b/src/callproc.c index ff28a49..9b39b48 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -772,13 +772,14 @@ child_setup (int in, int out, int err, char **new_argv, close (out); close (err); - /* I can't think of any reason why child processes need any more - than the standard 3 file descriptors. It would be cleaner to + /* Close non-process-related file descriptors. It would be cleaner to close just the ones that need to be, but the following brute force approach is certainly effective, and not too slow. */ + { int fd; - for (fd=3; fd<=64; fd++) + + for (fd = 3; fd < MAXDESC; fd++) close (fd); } #endif /* not WIN32_NATIVE */