summaryrefslogtreecommitdiffstats
path: root/usr.sbin/wsmoused
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-06-28 13:32:41 +0000
committerderaadt <deraadt@openbsd.org>2019-06-28 13:32:41 +0000
commitdf69c215c7c66baf660f3f65414fd34796c96152 (patch)
tree0255639162b24c4a2f761a274e32b69c2256fd45 /usr.sbin/wsmoused
parentminiroot prototype disklabels should attempt to contain accurate (diff)
downloadwireguard-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/wsmoused')
-rw-r--r--usr.sbin/wsmoused/mouse_protocols.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/wsmoused/mouse_protocols.c b/usr.sbin/wsmoused/mouse_protocols.c
index 2caf4b10a14..81ab3f713be 100644
--- a/usr.sbin/wsmoused/mouse_protocols.c
+++ b/usr.sbin/wsmoused/mouse_protocols.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mouse_protocols.c,v 1.16 2014/05/14 18:28:22 shadchin Exp $ */
+/* $OpenBSD: mouse_protocols.c,v 1.17 2019/06/28 13:32:51 deraadt Exp $ */
/*
* Copyright (c) 2001 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon
@@ -189,7 +189,7 @@ SetMouseSpeed(int old, unsigned int cflag)
struct termios tty;
char *c;
- if (tcgetattr(mouse.mfd, &tty) < 0) {
+ if (tcgetattr(mouse.mfd, &tty) == -1) {
debug("Warning: %s unable to get status of mouse fd (%s)\n",
mouse.portname, strerror(errno));
return;
@@ -220,7 +220,7 @@ SetMouseSpeed(int old, unsigned int cflag)
cfsetospeed(&tty, B1200);
}
- if (tcsetattr(mouse.mfd, TCSADRAIN, &tty) < 0)
+ if (tcsetattr(mouse.mfd, TCSADRAIN, &tty) == -1)
logerr(1, "unable to get mouse status. Exiting...\n");
c = "*n";
@@ -233,7 +233,7 @@ SetMouseSpeed(int old, unsigned int cflag)
}
usleep(100000);
- if (tcsetattr(mouse.mfd, TCSADRAIN, &tty) < 0)
+ if (tcsetattr(mouse.mfd, TCSADRAIN, &tty) == -1)
logerr(1, "unable to get mouse status. Exiting...\n");
}