input_file: check fstat() failure
This commit is contained in:
parent
fb08213659
commit
84f7d9c6b3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user