2019-02-11 05:05:43 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"syscall"
|
|
|
|
)
|
|
|
|
|
|
|
|
func cleanZombies() {
|
2022-03-08 10:45:56 +00:00
|
|
|
return // FIXME noop... udhcpc is a daemon staying alive so we never finish
|
|
|
|
|
2019-02-11 05:05:43 +00:00
|
|
|
var wstatus syscall.WaitStatus
|
|
|
|
|
|
|
|
for {
|
|
|
|
pid, err := syscall.Wait4(-1, &wstatus, 0, nil)
|
|
|
|
switch err {
|
|
|
|
case nil:
|
|
|
|
log.Printf("collected PID %v", pid)
|
|
|
|
|
|
|
|
case syscall.ECHILD:
|
|
|
|
return
|
|
|
|
|
|
|
|
default:
|
|
|
|
log.Printf("unknown error: %v", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|