From bf2d0db680f16394df6f0b9c4ee0c0738862276c Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 10 Mar 2010 11:58:04 -0600 Subject: [PATCH] vos: Use IOMGR_SoftSig for signals When vsprocs tries to longjmp from the signal handler, use IOMGR_SoftSig first, so sleeping processes are woken back up. Without this, IOMGR can bail out since it finds no processes READY when we attempt to do anything with RX. Change-Id: I9089bc4d003786d4a2205cd97f722fbf85fd1aa8 Reviewed-on: http://gerrit.openafs.org/1558 Tested-by: Andrew Deason Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/volser/volser_internal.h | 1 - src/volser/vsprocs.c | 17 +++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/volser/volser_internal.h b/src/volser/volser_internal.h index b0e8b60..fa98c7a 100644 --- a/src/volser/volser_internal.h +++ b/src/volser/volser_internal.h @@ -52,7 +52,6 @@ extern int UV_CreateVolume3(afs_int32 aserver, afs_int32 apart, char *aname, afs_uint32 * aroid, afs_uint32 * abkid); extern int UV_AddVLDBEntry(afs_int32 aserver, afs_int32 apart, char *aname, afs_uint32 aid); -extern void sigint_handler(int x); extern int UV_MoveVolume(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart, afs_int32 atoserver, afs_int32 atopart); diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index caeaf4a..7728def 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -1143,8 +1143,8 @@ UV_DeleteVolume(afs_int32 aserver, afs_int32 apart, afs_uint32 avolid) jmp_buf env; int interrupt = 0; -void -sigint_handler(int x) +static void * +do_interrupt(void * unused) { if (interrupt) longjmp(env, 0); @@ -1156,9 +1156,18 @@ sigint_handler(int x) fflush(STDOUT); interrupt = 1; - (void)signal(SIGINT, sigint_handler); + return NULL; +} - return; +static void +sigint_handler(int x) +{ +#ifdef AFS_PTHREAD_ENV + do_interrupt(NULL); +#else + IOMGR_SoftSig(do_interrupt, 0); +#endif + (void)signal(SIGINT, sigint_handler); } /* Move volume on to -- 1.9.4