diff options
author | Zheng, Lei <zhenglei@pmail.ntu.edu.sg> | 2011-11-20 16:46:31 +0800 |
---|---|---|
committer | Zheng, Lei <zhenglei@pmail.ntu.edu.sg> | 2011-11-20 16:46:31 +0800 |
commit | 681755bcf5506109375e6fb9fc777461a704cf36 (patch) | |
tree | 77c0c3c05448cde4d64c0f743d252c7db3ccc9da /coreutils | |
parent | 846ac8422390ed9aa1f572a6089f2a7fc41f4aed (diff) | |
download | busybox-w32-681755bcf5506109375e6fb9fc777461a704cf36.tar.gz busybox-w32-681755bcf5506109375e6fb9fc777461a704cf36.tar.bz2 busybox-w32-681755bcf5506109375e6fb9fc777461a704cf36.zip |
Added missing stat() tweaks for mingw port
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/cp.c | 5 | ||||
-rw-r--r-- | coreutils/libcoreutils/cp_mv_stat.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c index ab17b39a6..bbdb10e95 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c | |||
@@ -131,8 +131,13 @@ int cp_main(int argc, char **argv) | |||
131 | last = argv[argc - 1]; | 131 | last = argv[argc - 1]; |
132 | /* If there are only two arguments and... */ | 132 | /* If there are only two arguments and... */ |
133 | if (argc == 2) { | 133 | if (argc == 2) { |
134 | #if ENABLE_PLATFORM_MINGW32 | ||
135 | /* stat can't be aliased, and MinGW uses lstat anyway */ | ||
136 | s_flags = cp_mv_stat2(*argv, &source_stat, lstat); | ||
137 | #else | ||
134 | s_flags = cp_mv_stat2(*argv, &source_stat, | 138 | s_flags = cp_mv_stat2(*argv, &source_stat, |
135 | (flags & FILEUTILS_DEREFERENCE) ? stat : lstat); | 139 | (flags & FILEUTILS_DEREFERENCE) ? stat : lstat); |
140 | #endif | ||
136 | if (s_flags < 0) | 141 | if (s_flags < 0) |
137 | return EXIT_FAILURE; | 142 | return EXIT_FAILURE; |
138 | d_flags = cp_mv_stat(last, &dest_stat); | 143 | d_flags = cp_mv_stat(last, &dest_stat); |
diff --git a/coreutils/libcoreutils/cp_mv_stat.c b/coreutils/libcoreutils/cp_mv_stat.c index 5ba07ecc3..1af2ebb71 100644 --- a/coreutils/libcoreutils/cp_mv_stat.c +++ b/coreutils/libcoreutils/cp_mv_stat.c | |||
@@ -46,5 +46,10 @@ int FAST_FUNC cp_mv_stat2(const char *fn, struct stat *fn_stat, stat_func sf) | |||
46 | 46 | ||
47 | int FAST_FUNC cp_mv_stat(const char *fn, struct stat *fn_stat) | 47 | int FAST_FUNC cp_mv_stat(const char *fn, struct stat *fn_stat) |
48 | { | 48 | { |
49 | #if ENABLE_PLATFORM_MINGW32 | ||
50 | /* stat can't be aliased, and MinGW uses lstat anyway */ | ||
51 | return cp_mv_stat2(fn, fn_stat, lstat); | ||
52 | #else | ||
49 | return cp_mv_stat2(fn, fn_stat, stat); | 53 | return cp_mv_stat2(fn, fn_stat, stat); |
54 | #endif | ||
50 | } | 55 | } |