summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2004-12-13 20:25:34 +0000
committerotto <otto@openbsd.org>2004-12-13 20:25:34 +0000
commit73609bedee8a4c645eb9678728b1c0d9fbdc786c (patch)
treeeceded3dd3087bfd90034b83f8b911e727ba4021
parentUse warnx() instead of warn() in four places where we know errno is zero. (diff)
downloadwireguard-openbsd-73609bedee8a4c645eb9678728b1c0d9fbdc786c.tar.xz
wireguard-openbsd-73609bedee8a4c645eb9678728b1c0d9fbdc786c.zip
Only warn if we try to cp(1) a socket. Consequently, this makes
mv(1)ing trees containing sockets across filesystems much more smooth. ok millert@ tedu@ fgsch@ pedro@ deraadt@
-rw-r--r--bin/cp/cp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/cp/cp.c b/bin/cp/cp.c
index 36dea977e4c..fb88e0bcee9 100644
--- a/bin/cp/cp.c
+++ b/bin/cp/cp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cp.c,v 1.28 2003/10/30 16:01:43 millert Exp $ */
+/* $OpenBSD: cp.c,v 1.29 2004/12/13 20:25:34 otto Exp $ */
/* $NetBSD: cp.c,v 1.14 1995/09/07 06:14:51 jtc Exp $ */
/*
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)cp.c 8.5 (Berkeley) 4/29/95";
#else
-static char rcsid[] = "$OpenBSD: cp.c,v 1.28 2003/10/30 16:01:43 millert Exp $";
+static char rcsid[] = "$OpenBSD: cp.c,v 1.29 2004/12/13 20:25:34 otto Exp $";
#endif
#endif /* not lint */
@@ -445,6 +445,9 @@ copy(char *argv[], enum op type, int fts_options)
if (copy_file(curr, fts_dne(curr)))
rval = 1;
break;
+ case S_IFSOCK:
+ warnx("%s: %s", curr->fts_path, strerror(EOPNOTSUPP));
+ break;
default:
if (copy_file(curr, fts_dne(curr)))
rval = 1;