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 /sbin/dhclient/dhclient.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 'sbin/dhclient/dhclient.c')
-rw-r--r-- | sbin/dhclient/dhclient.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index c7df8d40cea..2d05eb7bfa3 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.635 2019/05/22 12:56:31 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.636 2019/06/28 13:32:43 deraadt Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -1856,7 +1856,7 @@ write_option_db(char *name, struct client_lease *offered, else if (fprintf(optionDB, "%s", leasestr) == -1) log_warn("optionDB 'effective' fprintf()"); - if (fflush(optionDB) == -1) + if (fflush(optionDB) == EOF) log_warn("optionDB fflush()"); else if (fsync(fileno(optionDB)) == -1) log_warn("optionDB fsync()"); |