summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-06-03 14:45:19 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-06-03 14:45:19 -0700
commit6f5096b1885459bc0818c7634ba33c03e455dc7b (patch)
tree6e88b7697fa15417c019f600217e536ce01ea41c /init
parent2ddc27d0df310a21d96a998151933fab6b2e156d (diff)
parent982a815c10cc28707d81c46112fc45b1c10df3be (diff)
downloadsystem_core-6f5096b1885459bc0818c7634ba33c03e455dc7b.zip
system_core-6f5096b1885459bc0818c7634ba33c03e455dc7b.tar.gz
system_core-6f5096b1885459bc0818c7634ba33c03e455dc7b.tar.bz2
am 982a815c: Reap firmware child processes to prevent zombies
Diffstat (limited to 'init')
-rw-r--r--init/devices.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/init/devices.c b/init/devices.c
index 663cdfe..155a41e 100644
--- a/init/devices.c
+++ b/init/devices.c
@@ -31,6 +31,7 @@
#include <private/android_filesystem_config.h>
#include <sys/time.h>
#include <asm/page.h>
+#include <sys/wait.h>
#include "devices.h"
#include "util.h"
@@ -537,6 +538,8 @@ root_free_out:
static void handle_firmware_event(struct uevent *uevent)
{
pid_t pid;
+ int status;
+ int ret;
if(strcmp(uevent->subsystem, "firmware"))
return;
@@ -549,6 +552,10 @@ static void handle_firmware_event(struct uevent *uevent)
if (!pid) {
process_firmware_event(uevent);
exit(EXIT_SUCCESS);
+ } else {
+ do {
+ ret = waitpid(pid, &status, 0);
+ } while (ret == -1 && errno == EINTR);
}
}