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 /usr.sbin/npppctl | |
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 'usr.sbin/npppctl')
-rw-r--r-- | usr.sbin/npppctl/npppctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/npppctl/npppctl.c b/usr.sbin/npppctl/npppctl.c index 45c2a50185d..82706168073 100644 --- a/usr.sbin/npppctl/npppctl.c +++ b/usr.sbin/npppctl/npppctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: npppctl.c,v 1.8 2017/08/11 16:25:59 goda Exp $ */ +/* $OpenBSD: npppctl.c,v 1.9 2019/06/28 13:32:49 deraadt Exp $ */ /* * Copyright (c) 2012 Internet Initiative Japan Inc. @@ -102,12 +102,12 @@ main(int argc, char *argv[]) if ((result = parse(argc, argv)) == NULL) exit(EXIT_FAILURE); - if ((ctlsock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) + if ((ctlsock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) err(EXIT_FAILURE, "socket"); memset(&sun, 0, sizeof(sun)); sun.sun_family = AF_UNIX; strlcpy(sun.sun_path, npppd_ctlpath, sizeof(sun.sun_path)); - if (connect(ctlsock, (struct sockaddr *)&sun, sizeof(sun)) < 0) + if (connect(ctlsock, (struct sockaddr *)&sun, sizeof(sun)) == -1) err(EXIT_FAILURE, "connect"); imsg_init(&ctl_ibuf, ctlsock); |