aboutsummaryrefslogtreecommitdiffstats
path: root/src/input_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_file.c')
-rw-r--r--src/input_file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/input_file.c b/src/input_file.c
index c9543dff4..8ed9c3d75 100644
--- a/src/input_file.c
+++ b/src/input_file.c
@@ -44,6 +44,12 @@ input_file_open(struct input_stream *is, const char *filename)
is->seekable = true;
ret = fstat(fd, &st);
+ if (ret < 0) {
+ is->error = errno;
+ close(fd);
+ return false;
+ }
+
is->size = st.st_size;
#ifdef POSIX_FADV_SEQUENTIAL