diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-06-28 13:32:54 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-06-28 13:32:54 +0000 |
commit | 86ffccf24f66032a89d70a32b3609584c0db7345 (patch) | |
tree | 2ae97fac6ea5be57cc953baf8612e8f683da0172 /games/snake/snake.c | |
parent | ce9fea47562d4f179d45680d6aec00ede2877141 (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/snake/snake.c')
-rw-r--r-- | games/snake/snake.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/games/snake/snake.c b/games/snake/snake.c index b7a115fb645..b33e85e1173 100644 --- a/games/snake/snake.c +++ b/games/snake/snake.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snake.c,v 1.33 2019/01/20 04:14:19 tedu Exp $ */ +/* $OpenBSD: snake.c,v 1.34 2019/06/28 13:32:52 deraadt Exp $ */ /* $NetBSD: snake.c,v 1.8 1995/04/29 00:06:41 mycroft Exp $ */ /* @@ -971,7 +971,7 @@ readscores(int create) errc(1, ENAMETOOLONG, "%s/%s", home, ".snake.scores"); rawscores = open(scorepath, modint, 0666); - if (rawscores < 0) { + if (rawscores == -1) { if (create == 0) return 0; err(1, "cannot open %s", scorepath); |