]> arthur.barton.de Git - netatalk.git/commitdiff
signal() is deprecated
authorFrank Lahm <franklahm@googlemail.com>
Tue, 14 Sep 2010 05:51:00 +0000 (07:51 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Tue, 14 Sep 2010 05:51:00 +0000 (07:51 +0200)
etc/afpd/main.c

index ffe409e08e05b608fb55b23e5328e7cb47496161..de8ae711e3a6a2ac21ccf6a3b326f83d8d847d7f 100644 (file)
@@ -188,11 +188,6 @@ int main(int ac, char **av)
         exit(0);
     }
 
-#if 0
-    /* Register CNID  */
-    cnid_init();
-#endif
-
     /* install child handler for asp and dsi. we do this before afp_goaway
      * as afp_goaway references stuff from here. 
      * XXX: this should really be setup after the initial connections. */
@@ -201,16 +196,21 @@ int main(int ac, char **av)
         LOG(log_error, logtype_afpd, "main: server_child alloc: %s", strerror(errno) );
         afp_exit(EXITERR_SYS);
     }
-    
+
+    memset(&sv, 0, sizeof(sv));    
 #ifdef AFP3x
     /* linux at least up to 2.4.22 send a SIGXFZ for vfat fs,
        even if the file is open with O_LARGEFILE ! */
 #ifdef SIGXFSZ
-    signal(SIGXFSZ , SIG_IGN); 
+    sv.sa_handler = SIG_IGN;
+    sigemptyset( &sv.sa_mask );
+    if (sigaction(SIGXFSZ, &sv, NULL ) < 0 ) {
+        LOG(log_error, logtype_afpd, "main: sigaction: %s", strerror(errno) );
+        afp_exit(EXITERR_SYS);
+    }
+#endif
 #endif
-#endif    
     
-    memset(&sv, 0, sizeof(sv));
     sv.sa_handler = child_handler;
     sigemptyset( &sv.sa_mask );
     sigaddset(&sv.sa_mask, SIGALRM);