diff options
author | Anjali Nijhara <a.nijhara@samsung.com> | 2023-12-14 14:09:21 +0530 |
---|---|---|
committer | Anjali Nijhara <a.nijhara@samsung.com> | 2023-12-14 14:09:21 +0530 |
commit | 755acc1798caff3a7c1557157a88c878111e9427 (patch) | |
tree | b3e5e378f17b3d6c481f425b59e4025ecc5b2c87 | |
parent | ef13a4ac364731559d3f9ff9b5cf89217bbfa4d2 (diff) | |
download | toybox-755acc1798caff3a7c1557157a88c878111e9427.tar.gz toybox-755acc1798caff3a7c1557157a88c878111e9427.tar.bz2 toybox-755acc1798caff3a7c1557157a88c878111e9427.zip |
Modify run_notify func to wait for terminating child processaccepted/tizen/unified/riscv/20231226.211128accepted/tizen/unified/20231214.164957accepted/tizen_unified_riscv
Change-Id: Iec382fb152dcbcd3bf5511ce19c4235679365c75
-rw-r--r-- | toys/pending/dhcpd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/toys/pending/dhcpd.c b/toys/pending/dhcpd.c index 213a941..0a3a2c5 100644 --- a/toys/pending/dhcpd.c +++ b/toys/pending/dhcpd.c @@ -1186,6 +1186,8 @@ static void run_notify(char **argv) struct stat sts; volatile int error = 0; pid_t pid; + int rv = 0; + dbg("run_notify"); if (stat(argv[0], &sts) == -1 && errno == ENOENT) { infomsg(infomode, "notify file: %s : not exist.", argv[0]); @@ -1203,11 +1205,9 @@ static void run_notify(char **argv) error = errno; _exit(111); } - if (error) { - waitpid(pid, NULL, 0); - errno = error; - } - dbg("script complete.\n"); + waitpid(pid, &rv, 0); + errno = error; + dbg("wait pid (%u) rv (%d)", pid, rv); } static void write_leasefile(void) |