X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcallproc.c;h=9b39b48c7e3dc269dbf004570012566ef76609de;hb=ac7d0619aad74b1d57c4748ebb3ab29d9c32e3d8;hp=ff28a498243fda0756cc74aec8a7a7e0662fcebe;hpb=dbf2768f7b146e97e37a27316f70bb313f1acf15;p=chise%2Fxemacs-chise.git 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 */