From f639c65ac49b97fdf2445f6ba79da66eb986e925 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 9 Apr 2008 22:24:36 -0500 Subject: We don't open a destination filehandle for symlinks, so xclose() would barf. --- toys/cp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/toys/cp.c b/toys/cp.c index 81a1e418..04c6369b 100644 --- a/toys/cp.c +++ b/toys/cp.c @@ -87,6 +87,7 @@ void cp_file(char *src, char *dst, struct stat *srcst) // filehandle to them? O_NOFOLLOW causes the open to fail. if (!link || symlink(link, dst)) perror_msg("link '%s'", dst); free(link); + return; } else if (toys.optflags & FLAG_l) { if (link(src, dst)) perror_msg("link '%s'"); return; -- cgit v1.2.3