aboutsummaryrefslogtreecommitdiff
path: root/src/exec.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2023-05-02 16:02:32 +0300
committerSergey Poznyakoff <gray@gnu.org>2023-05-02 16:15:34 +0300
commit15874b30207fa29faf8ce9e64add011b5afa8e05 (patch)
treee0a36792cdbcdd822bcaa41fae9cf991b310f7a2 /src/exec.c
parent5ba0926fabd419e51f777f138389e3588bbd1ce9 (diff)
downloadwydawca-master.tar.gz
wydawca-master.tar.bz2
Add interface for closing file descriptors greater than or equal to the given one.HEADmaster
Diffstat (limited to 'src/exec.c')
-rw-r--r--src/exec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/exec.c b/src/exec.c
index 6c342c8..a56963f 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -52,8 +52,7 @@ start_prog(int argc, const char **argv, pid_t * ppid)
close(p[0]);
/* Close unneded descripitors */
- for (i = getdtablesize(); i > 2; i--)
- close(i);
+ wy_close_fds_above(2);
execvp(argv[0], (char **) argv);
wy_log(LOG_CRIT, _("cannot run %s: %s"), argv[0], strerror(errno));

Return to:

Send suggestions and report system problems to the System administrator.