]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/main.c
Merge remote-tracking branch 'origin/develop' into spotlight
[netatalk.git] / etc / afpd / main.c
index e89d0a2e9e58d6aacf2e2cc5af061a56959bb5dc..411b1a7d772e7ee0ac10595d54a75caaa01d8ef9 100644 (file)
@@ -38,6 +38,7 @@
 #include "fork.h"
 #include "uam_auth.h"
 #include "afp_zeroconf.h"
+#include "spotlight.h"
 
 #define AFP_LISTENERS 32
 #define FDSET_SAFETY  5
@@ -253,6 +254,13 @@ int main(int ac, char **av)
         afp_exit(EXITERR_SYS);
     }
 #endif
+
+    sv.sa_handler = SIG_IGN;
+    sigemptyset( &sv.sa_mask );
+    if (sigaction(SIGPIPE, &sv, NULL ) < 0 ) {
+        LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) );
+        afp_exit(EXITERR_SYS);
+    }
     
     sv.sa_handler = afp_goaway; /* handler for all sigs */
 
@@ -343,7 +351,7 @@ int main(int ac, char **av)
 
     /* Initialize */
     cnid_init();
-    
+
     /* watch atp, dsi sockets and ipc parent/child file descriptor. */
 
     if (obj.options.flags & OPTION_KEEPSESSIONS) {
@@ -382,12 +390,17 @@ int main(int ac, char **av)
 
         if (reloadconfig) {
             nologin++;
-            auth_unload();
+
             fd_reset_listening_sockets(&obj);
 
             LOG(log_info, logtype_afpd, "re-reading configuration file");
 
             configfree(&obj, NULL);
+            afp_config_free(&obj);
+
+            if (afp_config_parse(&obj, "afpd") != 0)
+                afp_exit(EXITERR_CONF);
+
             if (configinit(&obj) != 0) {
                 LOG(log_error, logtype_afpd, "config re-read: no servers configured");
                 afp_exit(EXITERR_CONF);