input_file: check fstat() failure
This commit is contained in:
@@ -44,6 +44,12 @@ input_file_open(struct input_stream *is, const char *filename)
|
|||||||
is->seekable = true;
|
is->seekable = true;
|
||||||
|
|
||||||
ret = fstat(fd, &st);
|
ret = fstat(fd, &st);
|
||||||
|
if (ret < 0) {
|
||||||
|
is->error = errno;
|
||||||
|
close(fd);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
is->size = st.st_size;
|
is->size = st.st_size;
|
||||||
|
|
||||||
#ifdef POSIX_FADV_SEQUENTIAL
|
#ifdef POSIX_FADV_SEQUENTIAL
|
||||||
|
Reference in New Issue
Block a user