From 982a815c10cc28707d81c46112fc45b1c10df3be Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 3 Jun 2010 12:21:01 -0700 Subject: [PATCH] Reap firmware child processes to prevent zombies Change-Id: Ic6c50b929a025f05450cd309238e60a857690d9b --- init/devices.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init/devices.c b/init/devices.c index 663cdfebc..155a41e77 100644 --- a/init/devices.c +++ b/init/devices.c @@ -31,6 +31,7 @@ #include #include #include +#include #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); } }