diff options
| author | Linus Torvalds <torvalds@penguin.transmeta.com> | 2003-02-10 22:58:04 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-02-10 22:58:04 -0800 |
| commit | 43fea1be12abf52dc12a61eef6059beed55c2df8 (patch) | |
| tree | 61be163e2e6f5367fc61d76f8bcabde48a2acc24 /drivers/hotplug | |
| parent | f0bec55fe38773d2022f1b585067a7a773942769 (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/hotplug')
| -rw-r--r-- | drivers/hotplug/cpci_hotplug_core.c | 6 | ||||
| -rw-r--r-- | drivers/hotplug/cpqphp_ctrl.c | 5 | ||||
| -rw-r--r-- | drivers/hotplug/ibmphp_hpc.c | 8 |
3 files changed, 5 insertions, 14 deletions
diff --git a/drivers/hotplug/cpci_hotplug_core.c b/drivers/hotplug/cpci_hotplug_core.c index 0b109d2aa9cc..e8981f780b62 100644 --- a/drivers/hotplug/cpci_hotplug_core.c +++ b/drivers/hotplug/cpci_hotplug_core.c @@ -622,8 +622,7 @@ event_thread(void *data) struct list_head *tmp; lock_kernel(); - daemonize(); - strcpy(current->comm, "cpci_hp_eventd"); + daemonize("cpci_hp_eventd"); unlock_kernel(); dbg("%s - event thread started", __FUNCTION__); @@ -682,8 +681,7 @@ poll_thread(void *data) struct list_head *tmp; lock_kernel(); - daemonize(); - strcpy(current->comm, "cpci_hp_polld"); + daemonize("cpci_hp_polld"); unlock_kernel(); while(1) { diff --git a/drivers/hotplug/cpqphp_ctrl.c b/drivers/hotplug/cpqphp_ctrl.c index deb229539165..b9a8432487f4 100644 --- a/drivers/hotplug/cpqphp_ctrl.c +++ b/drivers/hotplug/cpqphp_ctrl.c @@ -1709,10 +1709,7 @@ static int event_thread(void* data) { struct controller *ctrl; lock_kernel(); - daemonize(); - - // New name - strcpy(current->comm, "phpd_event"); + daemonize("phpd_event"); unlock_kernel(); diff --git a/drivers/hotplug/ibmphp_hpc.c b/drivers/hotplug/ibmphp_hpc.c index ae959809e8a8..0bc95c57056b 100644 --- a/drivers/hotplug/ibmphp_hpc.c +++ b/drivers/hotplug/ibmphp_hpc.c @@ -1125,13 +1125,9 @@ static int process_changeinlatch (u8 old, u8 new, struct controller *ctrl) static int hpc_poll_thread (void *data) { debug ("%s - Entry\n", __FUNCTION__); - lock_kernel (); - daemonize (); - // New name - strcpy (current->comm, "hpc_poll"); - - unlock_kernel (); + daemonize("hpc_poll"); + allow_signal(SIGKILL); poll_hpc (); |
