summaryrefslogtreecommitdiff
path: root/tools/mkenvimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mkenvimage.c')
-rw-r--r--tools/mkenvimage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c
index 8eee72e257..716cb73a5c 100644
--- a/tools/mkenvimage.c
+++ b/tools/mkenvimage.c
@@ -168,7 +168,7 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
readbytes = read(txt_fd, filebuf + filesize, readlen);
- if (errno) {
+ if (readbytes < 0) {
fprintf(stderr, "Error while reading stdin: %s\n",
strerror(errno));
return EXIT_FAILURE;