aboutsummaryrefslogtreecommitdiff
path: root/libbb/copy_file.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-03-22 13:15:08 +0000
committerRon Yorston <rmy@pobox.com>2012-03-22 13:15:08 +0000
commitc0d4367d6b581eb5989c02815880cf0fa2851ae8 (patch)
tree868c266e627e2d7f65ba5a4d5f98a1c421453181 /libbb/copy_file.c
parentf6bad5ef766b0447158e3de2f55c35f1f6cecb58 (diff)
parentda4441c44f6efccb6f7b7588404d9c6bfb7b6af8 (diff)
downloadbusybox-w32-c0d4367d6b581eb5989c02815880cf0fa2851ae8.tar.gz
busybox-w32-c0d4367d6b581eb5989c02815880cf0fa2851ae8.tar.bz2
busybox-w32-c0d4367d6b581eb5989c02815880cf0fa2851ae8.zip
Merge commit 'da4441c44f6efccb6f7b7588404d9c6bfb7b6af8' into merge
Conflicts: libbb/vfork_daemon_rexec.c networking/wget.c procps/ps.c
Diffstat (limited to 'libbb/copy_file.c')
-rw-r--r--libbb/copy_file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index adbc2dea3..48aaf481d 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -78,9 +78,9 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
78 /* NB: each struct stat is ~100 bytes */ 78 /* NB: each struct stat is ~100 bytes */
79 struct stat source_stat; 79 struct stat source_stat;
80 struct stat dest_stat; 80 struct stat dest_stat;
81 signed char retval = 0; 81 smallint retval = 0;
82 signed char dest_exists = 0; 82 smallint dest_exists = 0;
83 signed char ovr; 83 smallint ovr;
84 84
85/* Inverse of cp -d ("cp without -d") */ 85/* Inverse of cp -d ("cp without -d") */
86#define FLAGS_DEREF (flags & (FILEUTILS_DEREFERENCE + FILEUTILS_DEREFERENCE_L0)) 86#define FLAGS_DEREF (flags & (FILEUTILS_DEREFERENCE + FILEUTILS_DEREFERENCE_L0))
@@ -157,7 +157,6 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
157 } 157 }
158#endif 158#endif
159 159
160 /* Create DEST */
161 if (dest_exists) { 160 if (dest_exists) {
162 if (!S_ISDIR(dest_stat.st_mode)) { 161 if (!S_ISDIR(dest_stat.st_mode)) {
163 bb_error_msg("target '%s' is not a directory", dest); 162 bb_error_msg("target '%s' is not a directory", dest);
@@ -166,6 +165,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
166 /* race here: user can substitute a symlink between 165 /* race here: user can substitute a symlink between
167 * this check and actual creation of files inside dest */ 166 * this check and actual creation of files inside dest */
168 } else { 167 } else {
168 /* Create DEST */
169 mode_t mode; 169 mode_t mode;
170 saved_umask = umask(0); 170 saved_umask = umask(0);
171 171