aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-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 57d9dbfdb..9333a8d49 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))
@@ -147,7 +147,6 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
147 return -1; 147 return -1;
148 } 148 }
149 149
150 /* Create DEST */
151 if (dest_exists) { 150 if (dest_exists) {
152 if (!S_ISDIR(dest_stat.st_mode)) { 151 if (!S_ISDIR(dest_stat.st_mode)) {
153 bb_error_msg("target '%s' is not a directory", dest); 152 bb_error_msg("target '%s' is not a directory", dest);
@@ -156,6 +155,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
156 /* race here: user can substitute a symlink between 155 /* race here: user can substitute a symlink between
157 * this check and actual creation of files inside dest */ 156 * this check and actual creation of files inside dest */
158 } else { 157 } else {
158 /* Create DEST */
159 mode_t mode; 159 mode_t mode;
160 saved_umask = umask(0); 160 saved_umask = umask(0);
161 161