]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/main.c
Move and rename Spotlight module
[netatalk.git] / etc / afpd / main.c
index 2598a72ecc1424a78a7f902de1fbac0191e4c3d4..3e991c28e30cb4c8ca77e1f49a82433d84ac5754 100644 (file)
@@ -38,7 +38,6 @@
 #include "fork.h"
 #include "uam_auth.h"
 #include "afp_zeroconf.h"
-#include "spotlight.h"
 
 #define AFP_LISTENERS 32
 #define FDSET_SAFETY  5
@@ -211,8 +210,6 @@ static int setlimits(void)
 
 int main(int ac, char **av)
 {
-    fd_set              rfds;
-    void                *ipc;
     struct sigaction   sv;
     sigset_t            sigs;
     int                 ret;
@@ -254,6 +251,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 */
 
@@ -344,8 +348,6 @@ int main(int ac, char **av)
 
     /* Initialize */
     cnid_init();
-    if (obj.options.flags & OPTION_SPOTLIGHT)
-        sl_mod_load(_PATH_AFPDUAMPATH "mod_spotlight.so");
 
     /* watch atp, dsi sockets and ipc parent/child file descriptor. */
 
@@ -385,12 +387,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);
@@ -419,7 +426,7 @@ int main(int ac, char **av)
                 switch (polldata[i].fdtype) {
 
                 case LISTEN_FD:
-                    if (child = dsi_start(&obj, (DSI *)polldata[i].data, server_children)) {
+                    if ((child = dsi_start(&obj, (DSI *)polldata[i].data, server_children))) {
                         /* Add IPC fd to select fd set */
                         fdset_add_fd(obj.options.connections + AFP_LISTENERS + FDSET_SAFETY,
                                      &fdset,