Skip to content

Commit b9d5444

Browse files
author
Alec Clowes
committed
remove WNOHANG to wait for a child to exit instead of running in a busy loop
1 parent 9df6f66 commit b9d5444

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func removeZombies(childPid int) {
141141
var status syscall.WaitStatus
142142

143143
// wait for an orphaned zombie process
144-
pid, err := syscall.Wait4(-1, &status, syscall.WNOHANG, nil)
144+
pid, err := syscall.Wait4(-1, &status, 0, nil)
145145

146146
if pid == -1 {
147147
// if errno == ECHILD then no children remain; exit cleanly

0 commit comments

Comments
 (0)