Whamcloud - gitweb
LU-1299 clio: a combo patch to fix cl_lock
[fs/lustre-release.git] / libcfs / libcfs / linux / linux-prim.c
index 9ebfe70..e5c56b5 100644 (file)
@@ -310,34 +310,32 @@ cfs_block_allsigs(void)
         return old;
 }
 
-sigset_t
-cfs_block_sigs(sigset_t bits)
+sigset_t cfs_block_sigs(unsigned long sigs)
 {
-        unsigned long  flags;
-        sigset_t        old;
+       unsigned long  flags;
+       sigset_t        old;
 
-        SIGNAL_MASK_LOCK(current, flags);
-        old = current->blocked;
-        current->blocked = bits;
-        RECALC_SIGPENDING;
-        SIGNAL_MASK_UNLOCK(current, flags);
-        return old;
+       SIGNAL_MASK_LOCK(current, flags);
+       old = current->blocked;
+       sigaddsetmask(&current->blocked, sigs);
+       RECALC_SIGPENDING;
+       SIGNAL_MASK_UNLOCK(current, flags);
+       return old;
 }
 
 /* Block all signals except for the @sigs */
-cfs_sigset_t
-cfs_block_sigsinv(unsigned long sigs)
+sigset_t cfs_block_sigsinv(unsigned long sigs)
 {
-        unsigned long flags;
-        cfs_sigset_t old;
+       unsigned long flags;
+       sigset_t old;
 
-        SIGNAL_MASK_LOCK(current, flags);
-        old = current->blocked;
-        siginitsetinv(&current->blocked, sigs);
-        RECALC_SIGPENDING;
-        SIGNAL_MASK_UNLOCK(current, flags);
+       SIGNAL_MASK_LOCK(current, flags);
+       old = current->blocked;
+       sigaddsetmask(&current->blocked, ~sigs);
+       RECALC_SIGPENDING;
+       SIGNAL_MASK_UNLOCK(current, flags);
 
-        return old;
+       return old;
 }
 
 void