summaryrefslogtreecommitdiff
path: root/drivers/message
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2003-02-10 22:58:04 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2003-02-10 22:58:04 -0800
commit43fea1be12abf52dc12a61eef6059beed55c2df8 (patch)
tree61be163e2e6f5367fc61d76f8bcabde48a2acc24 /drivers/message
parentf0bec55fe38773d2022f1b585067a7a773942769 (diff)
Sanitize kernel daemon signal handling and process naming.
Add a name argument to daemonize() (va_arg) to avoid all the kernel threads having to duplicate the name setting over and over again. Make daemonize() disable all signals by default, and add a "allow_signal()" function to let daemons say they explicitly want to support a signal. Make flush_signal() take the signal lock, so that callers do not need to.
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/i2o/i2o_block.c6
-rw-r--r--drivers/message/i2o/i2o_core.c15
2 files changed, 6 insertions, 15 deletions
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index 05406290dde8..61fe2369e8f4 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -629,11 +629,9 @@ static int i2ob_evt(void *dummy)
u8 data[16];
} *evt_local;
- lock_kernel();
- daemonize();
- unlock_kernel();
+ daemonize("i2oblock");
+ allow_signal(SIGKILL);
- strcpy(current->comm, "i2oblock");
evt_running = 1;
while(1)
diff --git a/drivers/message/i2o/i2o_core.c b/drivers/message/i2o/i2o_core.c
index d4f15436a380..93ce837e421c 100644
--- a/drivers/message/i2o/i2o_core.c
+++ b/drivers/message/i2o/i2o_core.c
@@ -879,11 +879,9 @@ static int i2o_core_evt(void *reply_data)
struct i2o_controller *c = NULL;
unsigned long flags;
- lock_kernel();
- daemonize();
- unlock_kernel();
+ daemonize("i2oevtd");
+ allow_signal(SIGKILL);
- strcpy(current->comm, "i2oevtd");
evt_running = 1;
while(1)
@@ -1047,15 +1045,10 @@ static int i2o_dyn_lct(void *foo)
int found = 0;
int entries;
void *tmp;
- char name[16];
- lock_kernel();
- daemonize();
- unlock_kernel();
+ daemonize("iop%d_lctd", c->unit);
+ allow_signal(SIGKILL);
- sprintf(name, "iop%d_lctd", c->unit);
- strcpy(current->comm, name);
-
c->lct_running = 1;
while(1)