input_file: check fstat() failure

This commit is contained in:
Max Kellermann 2008-10-29 21:11:20 +01:00
parent fb08213659
commit 84f7d9c6b3

View File

@ -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