summaryrefslogtreecommitdiff
path: root/games/hangman/ksyms.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-28 13:32:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-28 13:32:54 +0000
commit86ffccf24f66032a89d70a32b3609584c0db7345 (patch)
tree2ae97fac6ea5be57cc953baf8612e8f683da0172 /games/hangman/ksyms.c
parentce9fea47562d4f179d45680d6aec00ede2877141 (diff)
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 'games/hangman/ksyms.c')
-rw-r--r--games/hangman/ksyms.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/games/hangman/ksyms.c b/games/hangman/ksyms.c
index bb6866ffb55..12dea84e06f 100644
--- a/games/hangman/ksyms.c
+++ b/games/hangman/ksyms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ksyms.c,v 1.11 2017/10/27 16:47:08 mpi Exp $ */
+/* $OpenBSD: ksyms.c,v 1.12 2019/06/28 13:32:52 deraadt Exp $ */
/*
* Copyright (c) 2008 Miodrag Vallat.
@@ -44,7 +44,7 @@ sym_getword(void)
if (lseek(symfd, pos + symoffs, SEEK_SET) == -1)
continue;
buflen = read(symfd, symbuf, BUFSIZ);
- if (buflen < 0)
+ if (buflen == -1)
continue;
/*
@@ -94,7 +94,7 @@ sym_getword(void)
int
sym_setup(void)
{
- if ((symfd = open(Dict_name, O_RDONLY)) < 0)
+ if ((symfd = open(Dict_name, O_RDONLY)) == -1)
return -1;
if (ksyms_elf_parse() == 0)