From 94150aba92d308e417aa552a1b3a957be264b423 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Tue, 7 Jan 2014 14:43:08 +0000 Subject: Revise mingw_stat to minimise changes from upstream BusyBox --- libbb/copy_file.c | 4 +--- libbb/recursive_action.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'libbb') 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) smallint retval = 0; smallint dest_exists = 0; smallint ovr; - int status; /* Inverse of cp -d ("cp without -d") */ #define FLAGS_DEREF (flags & (FILEUTILS_DEREFERENCE + FILEUTILS_DEREFERENCE_L0)) - status = FLAGS_DEREF ? stat(source, &source_stat) : lstat(source, &source_stat); - if (status < 0) { + if ((FLAGS_DEREF ? stat : lstat)(source, &source_stat) < 0) { /* This may be a dangling symlink. * Making [sym]links to dangling symlinks works, so... */ 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, if (depth == 0) follow = ACTION_FOLLOWLINKS | ACTION_FOLLOWLINKS_L0; follow &= flags; - status = follow ? stat(fileName, &statbuf) : lstat(fileName, &statbuf); + status = (follow ? stat : lstat)(fileName, &statbuf); if (status < 0) { #ifdef DEBUG_RECURS_ACTION bb_error_msg("status=%d flags=%x", status, flags); -- cgit v1.2.3-55-g6feb