mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-22 02:21:34 +00:00
fix EOF in hupper
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
58d2559067
commit
a6f3772589
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
@ -38,17 +39,14 @@ func main() {
|
|||||||
buf := make([]byte, 43)
|
buf := make([]byte, 43)
|
||||||
// initial state
|
// initial state
|
||||||
_, err = watch.Read(buf)
|
_, err = watch.Read(buf)
|
||||||
if err != nil {
|
if err != nil && err != io.EOF {
|
||||||
log.Fatalln("Error reading watch file", err)
|
log.Fatalln("Error reading watch file", err)
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
n, err := watch.Read(buf)
|
_, err := watch.Read(buf)
|
||||||
if err != nil {
|
if err != nil && err != io.EOF {
|
||||||
log.Fatalln("Error reading watch file", err)
|
log.Fatalln("Error reading watch file", err)
|
||||||
}
|
}
|
||||||
if n == 0 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
// a few changes eg debug do not require a daemon restart
|
// a few changes eg debug do not require a daemon restart
|
||||||
// however at present we cannot check changes, and most do
|
// however at present we cannot check changes, and most do
|
||||||
restart := true
|
restart := true
|
||||||
|
Loading…
Reference in New Issue
Block a user