]> arthur.barton.de Git - netatalk.git/commitdiff
Close client side of IPC fd in parent
authorFrank Lahm <franklahm@googlemail.com>
Thu, 26 Apr 2012 12:14:43 +0000 (14:14 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Thu, 26 Apr 2012 12:14:43 +0000 (14:14 +0200)
libatalk/dsi/dsi_getsess.c
libatalk/util/server_child.c

index ea22c2dca5cb096f5846c351913a82fd15ff0964..93d22435722671ff14c0ad78118a3677dac3fe45 100644 (file)
@@ -66,7 +66,7 @@ afp_child_t *dsi_getsession(DSI *dsi, server_child *serv_children, int tickleval
   default: /* parent */
     /* using SIGQUIT is hokey, but the child might not have
      * re-established its signal handler for SIGTERM yet. */
-    if ((child = server_child_add(serv_children, CHILD_DSIFORK, pid, ipc_fds)) ==  NULL) {
+    if ((child = server_child_add(serv_children, CHILD_DSIFORK, pid, ipc_fds[0])) ==  NULL) {
       LOG(log_error, logtype_dsi, "dsi_getsess: %s", strerror(errno));
       dsi->header.dsi_flags = DSIFL_REPLY;
       dsi->header.dsi_code = DSIERR_SERVBUSY;
@@ -74,6 +74,7 @@ afp_child_t *dsi_getsession(DSI *dsi, server_child *serv_children, int tickleval
       dsi->header.dsi_code = DSIERR_OK;
       kill(pid, SIGQUIT);
     }
+    close(ipc_fds[1]);
     dsi->proto_close(dsi);
     return child;
   }
index 1b30593ebd1bf801a03805c7f6fce3f7d1f9fb60..7fea57c8305a768cde34bc2b4fb72d0f62074e60 100644 (file)
@@ -218,9 +218,6 @@ void server_child_free(server_child *children)
 
                 if (child->ipc_fds[0] != -1)
                     close(child->ipc_fds[0]);
-                if (child->ipc_fds[1] != -1)
-                    close(child->ipc_fds[1]);
-
                 if (child->clientid) {
                     free(child->clientid);
                 }