goto ERROR;
}
+ // Let the kernel know, that we will read the file sequentially
+ r = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
+ if (r < 0) {
+ r = -errno;
+ goto ERROR;
+ }
// Re-open the file handle
f = fdopen(fd, "r");
// Allocate an object
file = calloc(1, sizeof(*file));
- if (!file)
+ if (!file) {
+ r = -errno;
goto ERROR;
+ }
// Store the file handle
file->f = f;
- // Let the kernel know, that we will read the file sequentially
- posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
-
// Open the archive
return archive_read_open2(a,
file, NULL, archive_file_read, archive_file_skip, archive_file_close);