]> arthur.barton.de Git - netatalk.git/commitdiff
autoconf option --enable-debugging to disable SIGALRM. See #2694606
authorfranklahm <franklahm>
Fri, 20 Mar 2009 09:10:25 +0000 (09:10 +0000)
committerfranklahm <franklahm>
Fri, 20 Mar 2009 09:10:25 +0000 (09:10 +0000)
configure.in
etc/afpd/afp_dsi.c
libatalk/dsi/dsi_tcp.c

index aa843839c050ff0ed4fd62178d9f7813f889143f..dde99636d7a3d88c9220d84c98fed6230bf3caf7 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.212 2009-02-27 09:14:40 franklahm Exp $
+dnl $Id: configure.in,v 1.213 2009-03-20 09:10:25 franklahm Exp $
 dnl configure.in for netatalk
 
 AC_INIT(etc/afpd/main.c)
@@ -299,6 +299,25 @@ AC_ARG_ENABLE(debug,
        ]
 )
 
+AC_MSG_CHECKING([whether to enable debugging with debuggers])
+AC_ARG_ENABLE(debugging,
+       [  --enable-debugging      disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
+       if test "$enableval" != "no"; then
+               if test "$enableval" = "yes"; then
+                       AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
+               else
+                       AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
+               fi 
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+       fi
+       ],[
+               AC_MSG_RESULT([no])
+       ]
+)
+
+
 afp3=no
 afp3set=no
 AC_MSG_CHECKING([whether AFP 3.x calls should be enabled])
index 673afe770f95257404b945729f4b9d2dc1b1d9ed..7ccdb10f24740406369e02fcb4c527a3ca441e40 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.35 2009-03-20 09:10:25 franklahm Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -288,6 +288,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 +303,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 +325,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:
index a54d7f359a6b900478f9d25bf2bbcb98b33d5a5e..9e7f93c5e42de311f666f0e7fa44141293edd0f1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dsi_tcp.c,v 1.12 2007-03-25 15:51:50 didg Exp $
+ * $Id: dsi_tcp.c,v 1.13 2009-03-20 09:10:25 franklahm Exp $
  *
  * Copyright (c) 1997, 1998 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
@@ -131,10 +131,11 @@ static int dsi_tcp_open(DSI *dsi)
     struct sigaction newact, oldact;
     u_int8_t block[DSI_BLOCKSIZ];
     size_t stored;
-    
+
     /* reset signals */
     server_reset_signal();
 
+#ifndef DEBUGGING
     /* install an alarm to deal with non-responsive connections */
     newact.sa_handler = timeout_handler;
     sigemptyset(&newact.sa_mask);
@@ -148,6 +149,7 @@ static int dsi_tcp_open(DSI *dsi)
        LOG(log_error, logtype_default, "dsi_tcp_open: %s", strerror(errno));
        exit(EXITERR_SYS);
     }
+#endif
     
     /* read in commands. this is similar to dsi_receive except
      * for the fact that we do some sanity checking to prevent
@@ -201,10 +203,11 @@ static int dsi_tcp_open(DSI *dsi)
     }
     
     /* stop timer and restore signal handler */
+#ifndef DEBUGGING
     memset(&timer, 0, sizeof(timer));
     setitimer(ITIMER_REAL, &timer, NULL);
     sigaction(SIGALRM, &oldact, NULL);
-
+#endif
     LOG(log_info, logtype_default,"ASIP session:%u(%d) from %s:%u(%d)", 
           ntohs(dsi->server.sin_port), dsi->serversock, 
           inet_ntoa(dsi->client.sin_addr), ntohs(dsi->client.sin_port),