]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/dsi/dsi_getsess.c
Close client side of IPC fd in parent
[netatalk.git] / libatalk / dsi / dsi_getsess.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;
   }