[git commit] cp: make verbose cp show symlink copies too

Denys Vlasenko vda.linux at googlemail.com
Thu Jul 14 18:58:39 UTC 2016


commit: https://git.busybox.net/busybox/commit/?id=ca003385f1e32646c249dfcd3717afbe7535dcec
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/copy_file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index 23bcf2e..7801b58 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -375,7 +375,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
 		}
 		/* _Not_ jumping to preserve_mode_ugid_time:
 		 * symlinks don't have those */
-		return 0;
+		goto verb_and_exit;
 	}
 	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)
@@ -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);
 	}
 
+ verb_and_exit:
 	if (flags & FILEUTILS_VERBOSE) {
 		printf("'%s' -> '%s'\n", source, dest);
 	}


More information about the busybox-cvs mailing list