Read exactly 43 bytes from watch

More and it hangs forever at present
Less and it will not read whole record

See https://github.com/docker/pinata/issues/766

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2016-01-25 21:10:13 +00:00
parent 1a2e92b7c8
commit 380c51010b

View File

@ -27,7 +27,8 @@ func main() {
if err != nil {
log.Fatalln("Failed to open file", path, err)
}
buf := make([]byte, 512)
// 43 bytes is the record size of the watch
buf := make([]byte, 43)
for {
_, err := watch.Read(buf)
if err != nil {