diff options
author | 2014-05-20 01:25:23 +0000 | |
---|---|---|
committer | 2014-05-20 01:25:23 +0000 | |
commit | 5ad04d351680822078003e2b066cfc9680d6157d (patch) | |
tree | bc78d1cc74e659478aa86d8884efcb9a0d678e50 /usr.bin/uudecode | |
parent | Bring UTF8_{getc,putc} up-to-date: it's been a decade since 5- and 6-byte (diff) | |
download | wireguard-openbsd-5ad04d351680822078003e2b066cfc9680d6157d.tar.xz wireguard-openbsd-5ad04d351680822078003e2b066cfc9680d6157d.zip |
Use errc/warnc to simplify code.
Also, in 'ftp', always put the error message last, after the hostname/ipaddr.
ok jsing@ krw@ millert@
Diffstat (limited to 'usr.bin/uudecode')
-rw-r--r-- | usr.bin/uudecode/uudecode.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c index f59f5787b06..2b03e6ef615 100644 --- a/usr.bin/uudecode/uudecode.c +++ b/usr.bin/uudecode/uudecode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uudecode.c,v 1.18 2012/03/04 04:05:15 fgsch Exp $ */ +/* $OpenBSD: uudecode.c,v 1.19 2014/05/20 01:25:23 guenther Exp $ */ /* $FreeBSD: uudecode.c,v 1.49 2003/05/03 19:44:46 obrien Exp $ */ /*- @@ -260,8 +260,7 @@ decode2(void) flags = O_WRONLY|O_CREAT|O_EXCL|O_NOFOLLOW; if (lstat(outfile, &st) == 0) { if (iflag) { - errno = EEXIST; - warn("%s: %s", infile, outfile); + warnc(EEXIST, "%s: %s", infile, outfile); return (0); } switch (st.st_mode & S_IFMT) { @@ -273,8 +272,7 @@ decode2(void) warn("%s: unlink %s", infile, outfile); return (1); case S_IFDIR: - errno = EISDIR; - warn("%s: %s", infile, outfile); + warnc(EISDIR, "%s: %s", infile, outfile); return (1); default: if (oflag) { @@ -282,8 +280,7 @@ decode2(void) flags &= ~(O_EXCL|O_NOFOLLOW); break; } - errno = EEXIST; - warn("%s: %s", infile, outfile); + warnc(EEXIST, "%s: %s", infile, outfile); return (1); } } else if (errno != ENOENT) { |