mine->f = f;
/*
* If we can't fstat() the file, it may just be that it's not
- * a file. (FILE * objects can wrap many kinds of I/O
- * streams, some of which don't support fileno()).)
+ * a file. (On some platforms, FILE * objects can wrap I/O
+ * streams that don't support fileno()). As a result, fileno()
+ * should be used cautiously.)
*/
if (fstat(fileno(mine->f), &st) == 0 && S_ISREG(st.st_mode)) {
archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
}
#ifdef __ANDROID__
+ /* fileno() isn't safe on all platforms ... see above. */
if (lseek(fileno(mine->f), skip, SEEK_CUR) < 0)
#elif HAVE_FSEEKO
if (fseeko(mine->f, skip, SEEK_CUR) != 0)