From 17baff480a7be5c07be629ada4fe940bf394ff31 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Wed, 20 Aug 2014 16:16:44 -0700 Subject: ueventd: call _exit for safety Make sure to call _exit instead of exit to avoid triggering exit handlers that may have existed in the parent process. Print out a log message when forking to process firmware events fails. Change-Id: I2436bdf85d9a8ea26b718e62023f1dac89864667 --- init/devices.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'init') diff --git a/init/devices.c b/init/devices.c index e27c311..8b00bf2 100644 --- a/init/devices.c +++ b/init/devices.c @@ -938,7 +938,9 @@ static void handle_firmware_event(struct uevent *uevent) pid = fork(); if (!pid) { process_firmware_event(uevent); - exit(EXIT_SUCCESS); + _exit(EXIT_SUCCESS); + } else if (pid < 0) { + log_event_print("could not fork to process firmware event: %s\n", strerror(errno)); } } -- cgit v1.1