diff options
author | deraadt <deraadt@openbsd.org> | 2019-06-28 13:32:41 +0000 |
---|---|---|
committer | deraadt <deraadt@openbsd.org> | 2019-06-28 13:32:41 +0000 |
commit | df69c215c7c66baf660f3f65414fd34796c96152 (patch) | |
tree | 0255639162b24c4a2f761a274e32b69c2256fd45 /distrib/special | |
parent | miniroot prototype disklabels should attempt to contain accurate (diff) | |
download | wireguard-openbsd-df69c215c7c66baf660f3f65414fd34796c96152.tar.xz wireguard-openbsd-df69c215c7c66baf660f3f65414fd34796c96152.zip |
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.
Diffstat (limited to 'distrib/special')
-rw-r--r-- | distrib/special/more/more.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/distrib/special/more/more.c b/distrib/special/more/more.c index b4eabd6ea8a..cd95e25eb0d 100644 --- a/distrib/special/more/more.c +++ b/distrib/special/more/more.c @@ -1,4 +1,4 @@ -/* $OpenBSD: more.c,v 1.40 2019/01/25 00:19:25 millert Exp $ */ +/* $OpenBSD: more.c,v 1.41 2019/06/28 13:32:52 deraadt Exp $ */ /* * Copyright (c) 2003 Todd C. Miller <millert@openbsd.org> @@ -1322,7 +1322,7 @@ retry: * Wait until we're in the foreground before we save the * the terminal modes. */ - if ((tgrp = tcgetpgrp(STDOUT_FILENO)) < 0) { + if ((tgrp = tcgetpgrp(STDOUT_FILENO)) == -1) { perror("tcgetpgrp"); exit(1); } @@ -1333,7 +1333,7 @@ retry: if ((term = getenv("TERM")) == 0 || tgetent(buf, term) <= 0) { dumb++; ul_opt = 0; } else { - if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) < 0) { + if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == -1) { Lpp = tgetnum("li"); Mcol = tgetnum("co"); } else { |