diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-12-07 15:44:05 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-12-07 15:49:01 +0200 |
commit | 1f528cbd617b49d20bbfc30c16e3dd810849b136 (patch) | |
tree | 6d248f1c079d4c62eb1e84ce5dd7cc03490b31d4 /lib | |
parent | 5c0938830468b5829d3106a34456e85896201d1a (diff) | |
download | pies-1f528cbd617b49d20bbfc30c16e3dd810849b136.tar.gz pies-1f528cbd617b49d20bbfc30c16e3dd810849b136.tar.bz2 |
Fix changing of the syslog dev. Fix bugs in closing unnecessary fds. Version 1.4.96
* lib/closefds.c [HAVE_FUNC_PROC_PIDINFO] (close_fds_sys): Fix
algorithm.
* src/pies.c (cb_syslog_dev): New callback. Handle "dev" using it.
(main): Don't close fd 2 before restarting.
* src/pies_syslog.h (pies_syslog_set_dev): New proto.
* src/progman.c (prog_start,run_command): Don't close necessary fds.
* src/syslog.c (pies_log_dev): Mark as static.
(pies_syslog_set_dev): New function.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/closefds.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/closefds.c b/lib/closefds.c index 50e8bfa..6fa227d 100644 --- a/lib/closefds.c +++ b/lib/closefds.c @@ -68,9 +68,10 @@ close_fds_sys (int minfd) n /= PROC_PIDLISTFD_SIZE; - for (i = minfd; i < n; i++) + for (i = 0; i < n; i++) { - close (fdinfo_buf[i].proc_fd); + if (fdinfo_buf[i].proc_fd >= minfd) + close (fdinfo_buf[i].proc_fd); } free (fdinfo); |