summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_read_open_fd.c
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2006-11-13 00:26:45 +0000
committerkientzle <kientzle@FreeBSD.org>2006-11-13 00:26:45 +0000
commit925ac6f1b9b066042073d7a1f49a8a722f1e37fe (patch)
treeed97538fdbb50cf64986e9c6b394dcd876243405 /lib/libarchive/archive_read_open_fd.c
parent7f111df0280b73ecaf3370e35a7e2dd7c92ba596 (diff)
downloadFreeBSD-src-925ac6f1b9b066042073d7a1f49a8a722f1e37fe.zip
FreeBSD-src-925ac6f1b9b066042073d7a1f49a8a722f1e37fe.tar.gz
Minor cleanup of the standard read/write I/O modules:
* Use public API, don't access struct archive directly. (People should be able to copy these into their applications as a template for custom I/O callbacks.) * Set "skip" only for regular files. ("skip" allows the low-level library to catch attempts to add an archive to itself or extract over itself.) * Simplify the write_open functions by just calling stat() at the beginning. Somehow, these functions had acquired some complex logic that tried to avoid the stat() call but never succeeded. MFC after: 10 days
Diffstat (limited to 'lib/libarchive/archive_read_open_fd.c')
-rw-r--r--lib/libarchive/archive_read_open_fd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libarchive/archive_read_open_fd.c b/lib/libarchive/archive_read_open_fd.c
index ad450a8..b873d07 100644
--- a/lib/libarchive/archive_read_open_fd.c
+++ b/lib/libarchive/archive_read_open_fd.c
@@ -89,8 +89,8 @@ file_open(struct archive *a, void *client_data)
return (ARCHIVE_FATAL);
}
- a->skip_file_dev = st.st_dev;
- a->skip_file_ino = st.st_ino;
+ if (S_ISREG(st.st_mode))
+ archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
return (ARCHIVE_OK);
}
OpenPOWER on IntegriCloud