cp: make verbose cp show symlink copies too

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2016-07-14 20:58:39 +02:00
parent 2a4d7f44a4
commit ca003385f1

View File

@ -375,7 +375,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
} }
/* _Not_ jumping to preserve_mode_ugid_time: /* _Not_ jumping to preserve_mode_ugid_time:
* symlinks don't have those */ * symlinks don't have those */
return 0; goto verb_and_exit;
} }
if (S_ISBLK(source_stat.st_mode) || S_ISCHR(source_stat.st_mode) if (S_ISBLK(source_stat.st_mode) || S_ISCHR(source_stat.st_mode)
|| S_ISSOCK(source_stat.st_mode) || S_ISFIFO(source_stat.st_mode) || S_ISSOCK(source_stat.st_mode) || S_ISFIFO(source_stat.st_mode)
@ -410,6 +410,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
bb_perror_msg("can't preserve %s of '%s'", "permissions", dest); bb_perror_msg("can't preserve %s of '%s'", "permissions", dest);
} }
verb_and_exit:
if (flags & FILEUTILS_VERBOSE) { if (flags & FILEUTILS_VERBOSE) {
printf("'%s' -> '%s'\n", source, dest); printf("'%s' -> '%s'\n", source, dest);
} }