summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2014-05-23 04:38:57 +0000
committerguenther <guenther@openbsd.org>2014-05-23 04:38:57 +0000
commit61c35f83bb7a3825fddac0ba4c721d8011ee0825 (patch)
tree4a67490d1e6aac4a980174d7b0c3121eeceda215
parentFree the est_fqlist allocations if we end up not using it. (diff)
downloadwireguard-openbsd-61c35f83bb7a3825fddac0ba4c721d8011ee0825.tar.xz
wireguard-openbsd-61c35f83bb7a3825fddac0ba4c721d8011ee0825.zip
Use errc/warnc to simplify code.
ok jca@ krw@
-rw-r--r--bin/ln/ln.c8
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;