fix EOF in hupper

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2016-02-01 18:05:06 +00:00
parent 58d2559067
commit a6f3772589

View File

@ -2,6 +2,7 @@ package main
import (
"flag"
"io"
"io/ioutil"
"log"
"os"
@ -38,17 +39,14 @@ func main() {
buf := make([]byte, 43)
// initial state
_, err = watch.Read(buf)
if err != nil {
if err != nil && err != io.EOF {
log.Fatalln("Error reading watch file", err)
}
for {
n, err := watch.Read(buf)
if err != nil {
_, err := watch.Read(buf)
if err != nil && err != io.EOF {
log.Fatalln("Error reading watch file", err)
}
if n == 0 {
continue
}
// a few changes eg debug do not require a daemon restart
// however at present we cannot check changes, and most do
restart := true