aboutsummaryrefslogtreecommitdiff
path: root/src/sysvinit.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-02-18 15:23:30 +0200
committerSergey Poznyakoff <gray@gnu.org>2016-02-18 15:33:34 +0200
commit0a55965bcc28928ae17ca39e3b8e35adf11ea09c (patch)
treeed8f6543999caef2d81b517fb90182be4a984fda /src/sysvinit.c
parentd5302613a00915076b945b25b50eb6b376121955 (diff)
downloadpies-0a55965bcc28928ae17ca39e3b8e35adf11ea09c.tar.gz
pies-0a55965bcc28928ae17ca39e3b8e35adf11ea09c.tar.bz2
Fix activation/deactivation of network listeners.
* src/ctl.c (prog_active): New function. (prog_serialize): Use prog_active to report prog's activity state. For listener components, return also their service and tcpmux master names, if applicable. (fun_stop): Stop listeners as well. (fun_start): Start listeners. (ctlio_end): Don't close fd: this is done by deregister_socket * src/inetd-bi.c (tcpmux_help): Don't list inactive components. * src/prog.h (prog_activate_listener) (prog_deactivate_listener): New protos. * src/progman.c (prog_lookup_by_tag) (prog_lookup_by_service): Remove. (progman_cleanup): Fix coredump (premature free). (progman_stop_component): If component is a listener, deactivate it. (prog_activate_listener) (prog_deactivate_listener): New functions. * src/socket.c (delete_sockinst): Close the socket descriptor. * src/sysvinit.c (sysvinit_fifo_handler, create_fifo): Don't close fd, leave that to deregister_socket.
Diffstat (limited to 'src/sysvinit.c')
-rw-r--r--src/sysvinit.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/sysvinit.c b/src/sysvinit.c
index 87a52d6..6276228 100644
--- a/src/sysvinit.c
+++ b/src/sysvinit.c
@@ -482,7 +482,6 @@ sysvinit_fifo_handler (int fd, void *data)
{
logmsg (LOG_ERR, _("end of file on %s: reopening"), init_fifo);
size = 0;
- close (fd);
deregister_socket (fd);
create_fifo ();
return 0;
@@ -573,10 +572,7 @@ create_fifo ()
{
fstat (fd, &fst);
if (fst.st_dev != st.st_dev || fst.st_ino != st.st_ino)
- {
- deregister_socket (fd);
- close (fd);
- }
+ deregister_socket (fd);
debug (1, ("reopening %s", init_fifo));
}

Return to:

Send suggestions and report system problems to the System administrator.