Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/* NB: each struct stat is ~100 bytes */
struct stat source_stat;
struct stat dest_stat;
- signed char retval = 0;
- signed char dest_exists = 0;
- signed char ovr;
+ smallint retval = 0;
+ smallint dest_exists = 0;
+ smallint ovr;
/* Inverse of cp -d ("cp without -d") */
#define FLAGS_DEREF (flags & (FILEUTILS_DEREFERENCE + FILEUTILS_DEREFERENCE_L0))
return -1;
}
- /* Create DEST */
if (dest_exists) {
if (!S_ISDIR(dest_stat.st_mode)) {
bb_error_msg("target '%s' is not a directory", dest);
/* race here: user can substitute a symlink between
* this check and actual creation of files inside dest */
} else {
+ /* Create DEST */
mode_t mode;
saved_umask = umask(0);