]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_dsi.c
fce: FCE version 2 with new event types and new config options
[netatalk.git] / etc / afpd / afp_dsi.c
index b64d49140f402fc1ddb0f1f0205263563e9808d1..eb7f796e19ca366fb09f7d8b2dfd15ad443e34af 100644 (file)
@@ -337,6 +337,11 @@ static void alarm_handler(int sig _U_)
     }
 }
 
+static void child_handler(void)
+{
+    wait(NULL);
+}
+
 /* ----------------- 
    if dsi->in_write is set attention, tickle (and close?) msg
    aren't sent. We don't care about tickle 
@@ -428,6 +433,17 @@ void afp_over_dsi_sighandlers(AFPObj *obj)
         afp_dsi_die(EXITERR_SYS);
     }
 #endif /* DEBUGGING */
+
+    /*  SIGCLD */
+    action.sa_handler = child_handler;
+#ifdef SA_NOCLDWAIT
+/* this enhancement simplifies things for Solaris, it also improves performance */
+    action.sa_flags |= SA_NOCLDWAIT;
+#endif
+    if (sigaction(SIGCLD, &action, NULL) < 0 ) {
+        LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) );
+        afp_dsi_die(EXITERR_SYS);
+    }
 }
 
 /* -------------------------------------------
@@ -477,7 +493,7 @@ void afp_over_dsi(AFPObj *obj)
 
     /* Initialize Spotlight */
     if ((obj->options.flags & OPTION_SPOTLIGHT) && (obj->options.slmod_path))
-        sl_mod_load(obj->options.slmod_path);
+        sl_mod_load(obj);
 
     ipc_child_state(obj, DSI_RUNNING);
 
@@ -533,7 +549,7 @@ void afp_over_dsi(AFPObj *obj)
 
         if (reload_request) {
             reload_request = 0;
-            load_volumes(AFPobj);
+            load_volumes(AFPobj, lv_none);
         }
 
         /* The first SIGINT enables debugging, the next restores the config */