io: don't leave errno as a random value when we hit EOF.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 18 Oct 2018 00:29:00 +0000 (10:59 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 18 Oct 2018 00:29:00 +0000 (10:59 +1030)
commitfedf515165bfafaf4fb98252ecda1abe050c8da5
treea4bc3955b70d3871a647847979fcdaa0bb11a8a0
parentb6e8d929d2c0c37afc840ac99e3e0f469e33e6c0
io: don't leave errno as a random value when we hit EOF.

It's used inside io_finish; setting to 0 allows that to know we hit
EOF on a read.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/io/io.c
ccan/io/io.h
ccan/io/test/run-45-eof.c [new file with mode: 0644]