volser: convert the volume server to opr softsig 95/11995/8
authorMichael Meffie <mmeffie@sinenomine.net>
Wed, 2 Sep 2015 20:28:43 +0000 (16:28 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 25 Apr 2016 03:59:58 +0000 (23:59 -0400)
Convert the volume server from regular signal handling to the opr soft
signal handling when built with pthreads. This makes it safe to call
pthread functions within signal handlers.

Change-Id: I25b9a9184c526f4ce9b6e2abb25ae9135cc97ec6
Reviewed-on: https://gerrit.openafs.org/11995
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/volser/volmain.c

index cf16ac9..e385214 100644 (file)
@@ -14,6 +14,8 @@
 #include <afs/opr.h>
 #ifdef AFS_PTHREAD_ENV
 # include <opr/lock.h>
+# include <opr/softsig.h>
+# include <afs/procmgmt_softsig.h> /* must come after softsig */
 #endif
 
 #ifdef AFS_NT40_ENV
@@ -501,7 +503,12 @@ main(int argc, char **argv)
     rx_SetRxDeadTime(420);
     memset(busyFlags, 0, sizeof(busyFlags));
 
+#ifdef AFS_PTHREAD_ENV
+    opr_softsig_Init();
+    SetupLogSoftSignals();
+#else
     SetupLogSignals();
+#endif
 
     {
 #ifdef AFS_PTHREAD_ENV