diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-05-23 04:38:58 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-05-23 04:38:58 +0000 |
commit | 232afbbadb911161014af4a0629cf91c2c263cf8 (patch) | |
tree | e4fd0d95c90a7436c4263cf00089172c8571127e /bin | |
parent | 687f30bab48ef7e8690175b922b13f038044e2f0 (diff) |
Use errc/warnc to simplify code.
ok jca@ krw@
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ln/ln.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/ln/ln.c b/bin/ln/ln.c index 5a6dd9b1ba5..8d86167cbef 100644 --- a/bin/ln/ln.c +++ b/bin/ln/ln.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ln.c,v 1.20 2014/05/07 12:37:04 schwarze Exp $ */ +/* $OpenBSD: ln.c,v 1.21 2014/05/23 04:38:57 guenther Exp $ */ /* $NetBSD: ln.c,v 1.10 1995/03/21 09:06:10 cgd Exp $ */ /* @@ -124,8 +124,7 @@ linkit(char *target, char *source, int isdir) } /* Only symbolic links to directories. */ if (S_ISDIR(sb.st_mode)) { - errno = EISDIR; - warn("%s", target); + warnc(EISDIR, "%s", target); return (1); } } @@ -140,8 +139,7 @@ linkit(char *target, char *source, int isdir) } n = snprintf(path, sizeof(path), "%s/%s", source, p); if (n < 0 || n >= sizeof(path)) { - errno = ENAMETOOLONG; - warn("%s/%s", source, p); + warnc(ENAMETOOLONG, "%s/%s", source, p); return (1); } source = path; |