summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authordanny webster <dannywebster@googlemail.com>2009-08-12 09:39:20 +0100
committerdanny webster <dannywebster@googlemail.com>2009-08-12 09:39:20 +0100
commite1636a06d48740791132319d080862a95596e07e (patch)
tree6be22e34b0130d28d0218755a326dc3de21c0b2d /usr/src
parent42e542bc9dde55564c7d1f104b79094f19319351 (diff)
downloadillumos-joyent-e1636a06d48740791132319d080862a95596e07e.tar.gz
6344436 *mv* gives cryptic error when applied to unix domain sockets
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/mv/mv.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/usr/src/cmd/mv/mv.c b/usr/src/cmd/mv/mv.c
index e2fd05f9ff..dcf0f1827e 100644
--- a/usr/src/cmd/mv/mv.c
+++ b/usr/src/cmd/mv/mv.c
@@ -66,6 +66,7 @@
#define ISDEV(A) ((A.st_mode & S_IFMT) == S_IFCHR || \
(A.st_mode & S_IFMT) == S_IFBLK || \
(A.st_mode & S_IFMT) == S_IFIFO)
+#define ISSOCK(A) ((A.st_mode & S_IFMT) == S_IFSOCK)
#define BLKSIZE 4096
#define PATHSIZE 1024
@@ -477,7 +478,7 @@ lnkfil(char *source, char *target)
/*
* Make sure source file is not a directory,
- * we can't link directories...
+ * we cannot link directories...
*/
if (ISDIR(s1)) {
@@ -643,15 +644,24 @@ cpymve(char *source, char *target)
return (n);
}
- /* doors can't be moved across filesystems */
+ /* doors cannot be moved across filesystems */
if (ISDOOR(s1)) {
(void) fprintf(stderr,
- gettext("%s: %s: can't move door "
+ gettext("%s: %s: cannot move door "
"across file systems\n"), cmd, source);
return (1);
}
+
+ /* sockets cannot be moved across filesystems */
+ if (ISSOCK(s1)) {
+ (void) fprintf(stderr,
+ gettext("%s: %s: cannot move socket "
+ "across file systems\n"), cmd, source);
+ return (1);
+ }
+
/*
- * File can't be renamed, try to recreate the symbolic
+ * File cannot be renamed, try to recreate the symbolic
* link or special device, or copy the file wholesale
* between file systems.
*/
@@ -1212,7 +1222,7 @@ getrealpath(char *path, char *rpath)
if (realpath(path, rpath) == NULL) {
int errno_save = errno;
(void) fprintf(stderr, gettext(
- "%s: can't resolve path %s: "), cmd, path);
+ "%s: cannot resolve path %s: "), cmd, path);
errno = errno_save;
perror("");
return (0);