1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-07 17:17:44 +03:00

[PATCH] fix udevd zombies

The recent version of klibc switched to -mregparm=3. This broke the
signal handlers parameter, cause it is called directly from the kernel
with the parameter on the stack not in a register.
This commit is contained in:
kay.sievers@vrfy.org 2004-06-07 02:56:47 -07:00 committed by Greg KH
parent 0f36e68e8a
commit 47bf9196c6
2 changed files with 6 additions and 5 deletions

6
udev.c
View File

@ -55,7 +55,7 @@ void log_message(int level, const char *format, ...)
} }
#endif #endif
static void sig_handler(int signum) __attribute__((regparm(0))) static void sig_handler(int signum)
{ {
switch (signum) { switch (signum) {
case SIGINT: case SIGINT:
@ -63,7 +63,7 @@ static void sig_handler(int signum)
udevdb_exit(); udevdb_exit();
exit(20 + signum); exit(20 + signum);
default: default:
dbg("unhandled signal"); dbg("unhandled signal %d", signum);
} }
} }
@ -128,7 +128,7 @@ static int udev_hotplug(void)
goto exit; goto exit;
} }
/* set up a default signal handler for now */ /* set signal handlers */
act.sa_handler = sig_handler; act.sa_handler = sig_handler;
sigemptyset (&act.sa_mask); sigemptyset (&act.sa_mask);
act.sa_flags = SA_RESTART; act.sa_flags = SA_RESTART;

View File

@ -306,9 +306,10 @@ skip:
return; return;
} }
static void sig_handler(int signum) __attribute__((regparm(0))) static void sig_handler(int signum)
{ {
int rc; int rc;
switch (signum) { switch (signum) {
case SIGINT: case SIGINT:
case SIGTERM: case SIGTERM:
@ -325,7 +326,7 @@ static void sig_handler(int signum)
goto do_write; goto do_write;
break; break;
default: default:
dbg("unhandled signal"); dbg("unhandled signal %d", signum);
return; return;
} }