Do not return true from slurp() if it failed to read
Do not return true from slurp() if it failed to read

Failing to read() some data into the destination buffer from the slurp()
function was not considered an error. This means that we were
potentially leaving the caller with an uninitialized destination buffer
without letting him know it's uninitialized.

It is quite unlikely that a single call to read() would ever fail right
after a successful call to open(..., O_RDONLY). However, one practical
example of this happening is when the file being opened is actually a
directory.

Fixed by propagating the error (i.e. returning false from slurp()) if
the call to read() fails.

Signed-off-by: Olivier Gayot <177cb43a9a0ccab7ae6d0e6a74e79a9be7a5415d@sigexec.com>

i3/i3status,Gravemind/i3status,Dettorer/i3status,i3/i3status,Gravemind/i3status,peder2tm/i3status-netdev,Dettorer/i3status,peder2tm/i3status-netdev,Dettorer/i3status,i3/i3status,peder2tm/i3status-netdev,Gravemind/i3status,Dettorer/i3status,peder2tm/i3status-netdev,i3/i3status,Gravemind/i3status