From 681755bcf5506109375e6fb9fc777461a704cf36 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Sun, 20 Nov 2011 16:46:31 +0800 Subject: Added missing stat() tweaks for mingw port --- libbb/copy_file.c | 3 +++ libbb/recursive_action.c | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'libbb') diff --git a/libbb/copy_file.c b/libbb/copy_file.c index 2134ee046..d9bbb6ba3 100644 --- a/libbb/copy_file.c +++ b/libbb/copy_file.c @@ -105,12 +105,15 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) return -1; } } else { +#if !ENABLE_PLATFORM_MINGW32 + /* MinGW does not have inode, and does not use device */ if (source_stat.st_dev == dest_stat.st_dev && source_stat.st_ino == dest_stat.st_ino ) { bb_error_msg("'%s' and '%s' are the same file", source, dest); return -1; } +#endif dest_exists = 1; } diff --git a/libbb/recursive_action.c b/libbb/recursive_action.c index b5cf7c0ab..560c93cad 100644 --- a/libbb/recursive_action.c +++ b/libbb/recursive_action.c @@ -73,7 +73,12 @@ int FAST_FUNC recursive_action(const char *fileName, if (depth == 0) follow = ACTION_FOLLOWLINKS | ACTION_FOLLOWLINKS_L0; follow &= flags; +#if ENABLE_PLATFORM_MINGW32 + /* stat can't be aliased, and MinGW uses lstat anyway */ + status = lstat(fileName, &statbuf); +#else status = (follow ? stat : lstat)(fileName, &statbuf); +#endif if (status < 0) { #ifdef DEBUG_RECURS_ACTION bb_error_msg("status=%d flags=%x", status, flags); -- cgit v1.2.3-55-g6feb