mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-24 19:28:09 +00:00
fix hupper
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
6c838d846f
commit
bdee0f1a78
@ -30,17 +30,22 @@ func main() {
|
|||||||
// 43 bytes is the record size of the watch
|
// 43 bytes is the record size of the watch
|
||||||
buf := make([]byte, 43)
|
buf := make([]byte, 43)
|
||||||
for {
|
for {
|
||||||
_, err := watch.Read(buf)
|
n, err := watch.Read(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln("Error reading watch file", err)
|
log.Fatalln("Error reading watch file", err)
|
||||||
}
|
}
|
||||||
|
if n == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
bytes, err := ioutil.ReadFile(pidfile)
|
bytes, err := ioutil.ReadFile(pidfile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
pidstring := string(bytes[:])
|
pidstring := string(bytes[:])
|
||||||
pid, err := strconv.Atoi(pidstring)
|
pid, err := strconv.Atoi(pidstring)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
syscall.Kill(pid, syscall.SIGHUP)
|
syscall.Kill(pid, syscall.SIGHUP)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user