summaryrefslogtreecommitdiff
path: root/libarchive/archive_write_disk_posix.c
diff options
context:
space:
mode:
authorMartin Matuška <martin@matuska.org>2019-04-06 19:15:32 +0200
committerGitHub <noreply@github.com>2019-04-06 19:15:32 +0200
commitb309479cf9240738832df9240072bd654f29c1d6 (patch)
tree50f7735c9dc1014100373e8621241ff8939aa0a4 /libarchive/archive_write_disk_posix.c
parent0297127fd8374fe780b929b91a66d0c209dfc8ff (diff)
parentbf234723494dfd847bf7b030f2227c7bbd99b36b (diff)
downloadlibarchive-b309479cf9240738832df9240072bd654f29c1d6.tar.gz
Merge pull request #1076 from uckelman-sf/fix_undef_stat
Windows compatibility: don't #undef stat and #define stat().
Diffstat (limited to 'libarchive/archive_write_disk_posix.c')
-rw-r--r--libarchive/archive_write_disk_posix.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
index ed154517..84e8f80e 100644
--- a/libarchive/archive_write_disk_posix.c
+++ b/libarchive/archive_write_disk_posix.c
@@ -2032,7 +2032,7 @@ restore_entry(struct archive_write_disk *a)
* follow the symlink if we're creating a dir.
*/
if (S_ISDIR(a->mode))
- r = stat(a->name, &a->st);
+ r = la_stat(a->name, &a->st);
/*
* If it's not a dir (or it's a broken symlink),
* then don't follow it.
@@ -2198,7 +2198,7 @@ create_filesystem_object(struct archive_write_disk *a)
#ifdef HAVE_LSTAT
r = lstat(a->name, &st);
#else
- r = stat(a->name, &st);
+ r = la_stat(a->name, &st);
#endif
if (r != 0)
r = errno;
@@ -2712,7 +2712,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
* This is needed to extract hardlinks over
* symlinks.
*/
- r = stat(head, &st);
+ r = la_stat(head, &st);
if (r != 0) {
tail[0] = c;
if (errno == ENOENT) {
@@ -3052,7 +3052,7 @@ create_dir(struct archive_write_disk *a, char *path)
* here loses the ability to extract through symlinks. Also note
* that this should not use the a->st cache.
*/
- if (stat(path, &st) == 0) {
+ if (la_stat(path, &st) == 0) {
if (S_ISDIR(st.st_mode))
return (ARCHIVE_OK);
if ((a->flags & ARCHIVE_EXTRACT_NO_OVERWRITE)) {
@@ -3110,7 +3110,7 @@ create_dir(struct archive_write_disk *a, char *path)
* don't add it to the fixup list here, as it's already been
* added.
*/
- if (stat(path, &st) == 0 && S_ISDIR(st.st_mode))
+ if (la_stat(path, &st) == 0 && S_ISDIR(st.st_mode))
return (ARCHIVE_OK);
archive_set_error(&a->archive, errno, "Failed to create dir '%s'",