Reap firmware child processes to prevent zombies
Change-Id: Ic6c50b929a025f05450cd309238e60a857690d9b
This commit is contained in:
parent
f1a4618e99
commit
982a815c10
1 changed files with 7 additions and 0 deletions
|
|
@ -31,6 +31,7 @@
|
||||||
#include <private/android_filesystem_config.h>
|
#include <private/android_filesystem_config.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
|
||||||
#include "devices.h"
|
#include "devices.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
@ -537,6 +538,8 @@ root_free_out:
|
||||||
static void handle_firmware_event(struct uevent *uevent)
|
static void handle_firmware_event(struct uevent *uevent)
|
||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
int status;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if(strcmp(uevent->subsystem, "firmware"))
|
if(strcmp(uevent->subsystem, "firmware"))
|
||||||
return;
|
return;
|
||||||
|
|
@ -549,6 +552,10 @@ static void handle_firmware_event(struct uevent *uevent)
|
||||||
if (!pid) {
|
if (!pid) {
|
||||||
process_firmware_event(uevent);
|
process_firmware_event(uevent);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
|
} else {
|
||||||
|
do {
|
||||||
|
ret = waitpid(pid, &status, 0);
|
||||||
|
} while (ret == -1 && errno == EINTR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue