aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/copy_file.c3
-rw-r--r--libbb/recursive_action.c5
2 files changed, 8 insertions, 0 deletions
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)
105 return -1; 105 return -1;
106 } 106 }
107 } else { 107 } else {
108#if !ENABLE_PLATFORM_MINGW32
109 /* MinGW does not have inode, and does not use device */
108 if (source_stat.st_dev == dest_stat.st_dev 110 if (source_stat.st_dev == dest_stat.st_dev
109 && source_stat.st_ino == dest_stat.st_ino 111 && source_stat.st_ino == dest_stat.st_ino
110 ) { 112 ) {
111 bb_error_msg("'%s' and '%s' are the same file", source, dest); 113 bb_error_msg("'%s' and '%s' are the same file", source, dest);
112 return -1; 114 return -1;
113 } 115 }
116#endif
114 dest_exists = 1; 117 dest_exists = 1;
115 } 118 }
116 119
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,
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#if ENABLE_PLATFORM_MINGW32
77 /* stat can't be aliased, and MinGW uses lstat anyway */
78 status = lstat(fileName, &statbuf);
79#else
76 status = (follow ? stat : lstat)(fileName, &statbuf); 80 status = (follow ? stat : lstat)(fileName, &statbuf);
81#endif
77 if (status < 0) { 82 if (status < 0) {
78#ifdef DEBUG_RECURS_ACTION 83#ifdef DEBUG_RECURS_ACTION
79 bb_error_msg("status=%d flags=%x", status, flags); 84 bb_error_msg("status=%d flags=%x", status, flags);