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 /libexec/talkd/announce.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 'libexec/talkd/announce.c')
-rw-r--r-- | libexec/talkd/announce.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/talkd/announce.c b/libexec/talkd/announce.c index c5cd96989c7..00bdd0b8c96 100644 --- a/libexec/talkd/announce.c +++ b/libexec/talkd/announce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: announce.c,v 1.24 2016/02/01 07:25:51 mestre Exp $ */ +/* $OpenBSD: announce.c,v 1.25 2019/06/28 13:32:53 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -60,7 +60,7 @@ announce(CTL_MSG *request, char *remote_machine) return (FAILED); if ((tf = fopen(full_tty, "w")) == NULL) return (PERMISSION_DENIED); - if (fstat(fileno(tf), &stbuf) < 0) { + if (fstat(fileno(tf), &stbuf) == -1) { fclose(tf); return (PERMISSION_DENIED); } |