]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_dsi.c
remove most sparse warning 'symbol 'xxx' was not declared. Should it be static?'
[netatalk.git] / etc / afpd / afp_dsi.c
index 673afe770f95257404b945729f4b9d2dc1b1d9ed..2803236379b1c4113d28ab878860b455df0ec7f5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_dsi.c,v 1.34 2009-02-27 09:14:40 franklahm Exp $
+ * $Id: afp_dsi.c,v 1.39 2009-10-14 01:38:28 didg Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -43,8 +43,6 @@
 #include "uid.h"
 #endif /* FORCE_UIDGID */
 
-extern struct oforks   *writtenfork;
-
 #define CHILD_DIE         (1 << 0)
 #define CHILD_RUNNING     (1 << 1)
 #define CHILD_SLEEPING    (1 << 2)
@@ -108,7 +106,7 @@ static void afp_dsi_sleep(void)
 }
 
 /* ------------------- */
-static void afp_dsi_timedown()
+static void afp_dsi_timedown(int sig _U_)
 {
     struct sigaction   sv;
     struct itimerval   it;
@@ -156,7 +154,7 @@ static void afp_dsi_timedown()
 */
 volatile int reload_request = 0;
 
-static void afp_dsi_reload()
+static void afp_dsi_reload(int sig _U_)
 {
     reload_request = 1;
 }
@@ -170,7 +168,7 @@ static void afp_dsi_getmesg (int sig _U_)
 }
 #endif /* SERVERTEXT */
 
-static void alarm_handler()
+static void alarm_handler(int sig _U_)
 {
     int err;
 
@@ -217,6 +215,7 @@ void afp_over_dsi(AFPObj *obj)
     u_int32_t err, cmd;
     u_int8_t function;
     struct sigaction action;
+    const char *afpcmpstr;
 
     obj->exit = afp_dsi_die;
     obj->reply = (int (*)()) dsi_cmdreply;
@@ -288,6 +287,7 @@ void afp_over_dsi(AFPObj *obj)
         afp_dsi_die(EXITERR_SYS);
     }
 
+#ifndef DEBUGGING
     /* tickle handler */
     action.sa_handler = alarm_handler;
     sigemptyset(&action.sa_mask);
@@ -302,6 +302,7 @@ void afp_over_dsi(AFPObj *obj)
             (setitimer(ITIMER_REAL, &dsi->timer, NULL) < 0)) {
         afp_dsi_die(EXITERR_SYS);
     }
+#endif /* DEBUGGING */
 
 #ifdef DEBUG1
     fault_setup((void (*)(void *))afp_dsi_die);
@@ -323,7 +324,9 @@ void afp_over_dsi(AFPObj *obj)
                 dsi_tickle(dsi);
             continue;
         } else if (!(child.flags & CHILD_DIE)) { /* reset tickle timer */
+#ifndef DEBUGGING
             setitimer(ITIMER_REAL, &dsi->timer, NULL);
+#endif
         }
         switch(cmd) {
         case DSIFUNC_CLOSE:
@@ -360,12 +363,17 @@ void afp_over_dsi(AFPObj *obj)
                 dsi->datalen = DSI_DATASIZ;
                 child.flags |= CHILD_RUNNING;
 
+                afpcmpstr = AfpNum2name(function);
+                LOG(log_debug, logtype_afpd, "=> Start AFP command: %s", afpcmpstr);
+
                 err = (*afp_switch[function])(obj,
                                               dsi->commands, dsi->cmdlen,
                                               dsi->data, &dsi->datalen);
+
+                LOG(log_debug, logtype_afpd, "=> Finished AFP command: %s", afpcmpstr);
 #ifdef FORCE_UIDGID
                /* bring everything back to old euid, egid */
-               if (obj->force_uid)
+                if (obj->force_uid)
                    restore_uidgid ( &obj->uidgid );
 #endif /* FORCE_UIDGID */
                 child.flags &= ~CHILD_RUNNING;