patch-2.1.68 linux/net/sunrpc/clnt.c
Next file: linux/net/sunrpc/sched.c
Previous file: linux/net/socket.c
Back to the patch index
Back to the overall index
- Lines: 56
- Date:
Sun Nov 30 10:59:03 1997
- Orig file:
v2.1.67/linux/net/sunrpc/clnt.c
- Orig date:
Sat Nov 29 11:25:12 1997
diff -u --recursive --new-file v2.1.67/linux/net/sunrpc/clnt.c linux/net/sunrpc/clnt.c
@@ -60,8 +60,6 @@
static u32 * call_header(struct rpc_task *task);
static u32 * call_verify(struct rpc_task *task);
-#define _S(nr) (1 << ((nr) - 1))
-
/*
* Create an RPC client
* FIXME: This should also take a flags argument (as in task->tk_flags).
@@ -197,19 +195,24 @@
int flags, rpc_action func, void *data)
{
struct rpc_task my_task, *task = &my_task;
- unsigned long oldmask, sigallow = _S(SIGKILL);
+ unsigned long sigallow = sigmask(SIGKILL);
+ sigset_t oldset;
+ unsigned long irqflags;
int async, status;
/* Turn off various signals */
if (clnt->cl_intr) {
- struct sigaction *action = current->sig->action;
- if (action[SIGINT-1].sa_handler == SIG_DFL)
- sigallow |= _S(SIGINT);
- if (action[SIGQUIT-1].sa_handler == SIG_DFL)
- sigallow |= _S(SIGQUIT);
- }
- oldmask = current->blocked;
- current->blocked |= ~sigallow;
+ struct k_sigaction *action = current->sig->action;
+ if (action[SIGINT-1].sa.sa_handler == SIG_DFL)
+ sigallow |= sigmask(SIGINT);
+ if (action[SIGQUIT-1].sa.sa_handler == SIG_DFL)
+ sigallow |= sigmask(SIGQUIT);
+ }
+ spin_lock_irqsave(¤t->sigmask_lock, irqflags);
+ oldset = current->blocked;
+ siginitsetinv(¤t->blocked, sigallow & ~oldset.sig[0]);
+ recalc_sigpending(current);
+ spin_unlock_irqrestore(¤t->sigmask_lock, irqflags);
/* Create/initialize a new RPC task */
if ((async = (flags & RPC_TASK_ASYNC)) != 0) {
@@ -238,7 +241,11 @@
}
out:
- current->blocked = oldmask;
+ spin_lock_irqsave(¤t->sigmask_lock, irqflags);
+ current->blocked = oldset;
+ recalc_sigpending(current);
+ spin_unlock_irqrestore(¤t->sigmask_lock, irqflags);
+
return status;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov