From 61656abc7ff84215165af1bd464bc053b3b66158 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 28 Jun 2019 13:35:06 +0000 Subject: When system calls indicate an error they return -1, not some arbitrary value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future. --- usr.bin/uudecode/uudecode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/uudecode') diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c index 528a1725221..ad89732b0bd 100644 --- a/usr.bin/uudecode/uudecode.c +++ b/usr.bin/uudecode/uudecode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uudecode.c,v 1.26 2019/03/10 20:49:24 schwarze Exp $ */ +/* $OpenBSD: uudecode.c,v 1.27 2019/06/28 13:35:05 deraadt Exp $ */ /* $FreeBSD: uudecode.c,v 1.49 2003/05/03 19:44:46 obrien Exp $ */ /*- @@ -295,7 +295,7 @@ decode2(void) warn("%s: %s", infile, outfile); return (1); } - if ((fd = open(outfile, flags, mode)) < 0 || + if ((fd = open(outfile, flags, mode)) == -1 || (outfp = fdopen(fd, "w")) == NULL) { warn("%s: %s", infile, outfile); return (1); -- cgit v1.2.3