projects
/
unix-history
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
ed58e46
)
special case EEXIST for ln -s
author
Kirk McKusick
<mckusick@ucbvax.Berkeley.EDU>
Tue, 9 Nov 1982 01:54:56 +0000
(17:54 -0800)
committer
Kirk McKusick
<mckusick@ucbvax.Berkeley.EDU>
Tue, 9 Nov 1982 01:54:56 +0000
(17:54 -0800)
SCCS-vsn: bin/ln/ln.c 4.4
usr/src/bin/ln/ln.c
patch
|
blob
|
blame
|
history
diff --git
a/usr/src/bin/ln/ln.c
b/usr/src/bin/ln/ln.c
index
2d6df4b
..
446aed2
100644
(file)
--- a/
usr/src/bin/ln/ln.c
+++ b/
usr/src/bin/ln/ln.c
@@
-1,16
+1,18
@@
-static char sccsid[] = "@(#)ln.c 4.
3
%G%";
+static char sccsid[] = "@(#)ln.c 4.
4
%G%";
/*
* ln
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <errno.h>
struct stat stb;
int fflag; /* force flag set? */
int sflag;
char name[BUFSIZ];
char *rindex();
+extern int errno;
main(argc, argv)
int argc;
@@
-75,7
+77,10
@@
linkit(from, to)
to = name;
}
if ((*linkf)(from, to) < 0) {
- perror(from);
+ if (errno == EEXIST)
+ perror(to);
+ else
+ perror(from);
return (1);
}
return (0);