diff options
author | Ron Yorston <rmy@pobox.com> | 2014-01-07 14:43:08 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2014-01-07 14:43:08 +0000 |
commit | 94150aba92d308e417aa552a1b3a957be264b423 (patch) | |
tree | d9b570e2641188c68917e85d7cb387fe0bbfbecc /libbb | |
parent | 63b71e4a6f8c65a4bef7617efb50a2b473e388b3 (diff) | |
download | busybox-w32-94150aba92d308e417aa552a1b3a957be264b423.tar.gz busybox-w32-94150aba92d308e417aa552a1b3a957be264b423.tar.bz2 busybox-w32-94150aba92d308e417aa552a1b3a957be264b423.zip |
Revise mingw_stat to minimise changes from upstream BusyBox
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/copy_file.c | 4 | ||||
-rw-r--r-- | libbb/recursive_action.c | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c index 7da31f69d..be65c4b47 100644 --- a/libbb/copy_file.c +++ b/libbb/copy_file.c | |||
@@ -81,13 +81,11 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) | |||
81 | smallint retval = 0; | 81 | smallint retval = 0; |
82 | smallint dest_exists = 0; | 82 | smallint dest_exists = 0; |
83 | smallint ovr; | 83 | smallint ovr; |
84 | int status; | ||
85 | 84 | ||
86 | /* Inverse of cp -d ("cp without -d") */ | 85 | /* Inverse of cp -d ("cp without -d") */ |
87 | #define FLAGS_DEREF (flags & (FILEUTILS_DEREFERENCE + FILEUTILS_DEREFERENCE_L0)) | 86 | #define FLAGS_DEREF (flags & (FILEUTILS_DEREFERENCE + FILEUTILS_DEREFERENCE_L0)) |
88 | 87 | ||
89 | status = FLAGS_DEREF ? stat(source, &source_stat) : lstat(source, &source_stat); | 88 | if ((FLAGS_DEREF ? stat : lstat)(source, &source_stat) < 0) { |
90 | if (status < 0) { | ||
91 | /* This may be a dangling symlink. | 89 | /* This may be a dangling symlink. |
92 | * Making [sym]links to dangling symlinks works, so... */ | 90 | * Making [sym]links to dangling symlinks works, so... */ |
93 | if (flags & (FILEUTILS_MAKE_SOFTLINK|FILEUTILS_MAKE_HARDLINK)) | 91 | if (flags & (FILEUTILS_MAKE_SOFTLINK|FILEUTILS_MAKE_HARDLINK)) |
diff --git a/libbb/recursive_action.c b/libbb/recursive_action.c index 7ec3a1443..b5cf7c0ab 100644 --- a/libbb/recursive_action.c +++ b/libbb/recursive_action.c | |||
@@ -73,7 +73,7 @@ int FAST_FUNC recursive_action(const char *fileName, | |||
73 | if (depth == 0) | 73 | if (depth == 0) |
74 | follow = ACTION_FOLLOWLINKS | ACTION_FOLLOWLINKS_L0; | 74 | follow = ACTION_FOLLOWLINKS | ACTION_FOLLOWLINKS_L0; |
75 | follow &= flags; | 75 | follow &= flags; |
76 | status = follow ? stat(fileName, &statbuf) : lstat(fileName, &statbuf); | 76 | status = (follow ? stat : lstat)(fileName, &statbuf); |
77 | if (status < 0) { | 77 | if (status < 0) { |
78 | #ifdef DEBUG_RECURS_ACTION | 78 | #ifdef DEBUG_RECURS_ACTION |
79 | bb_error_msg("status=%d flags=%x", status, flags); | 79 | bb_error_msg("status=%d flags=%x", status, flags); |