summaryrefslogtreecommitdiff
path: root/usr.sbin/rmt
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-28 13:32:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-28 13:32:54 +0000
commit86ffccf24f66032a89d70a32b3609584c0db7345 (patch)
tree2ae97fac6ea5be57cc953baf8612e8f683da0172 /usr.sbin/rmt
parentce9fea47562d4f179d45680d6aec00ede2877141 (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 'usr.sbin/rmt')
-rw-r--r--usr.sbin/rmt/rmt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/rmt/rmt.c b/usr.sbin/rmt/rmt.c
index d1542b3083d..eaeba84c0a4 100644
--- a/usr.sbin/rmt/rmt.c
+++ b/usr.sbin/rmt/rmt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmt.c,v 1.22 2019/02/10 16:42:35 phessler Exp $ */
+/* $OpenBSD: rmt.c,v 1.23 2019/06/28 13:32:50 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -228,7 +228,7 @@ top:
}
}
rval = write(tape, record, n);
- if (rval < 0)
+ if (rval == -1)
goto ioerror;
goto respond;
@@ -238,7 +238,7 @@ top:
n = atoi(count);
record = checkbuf(record, n);
rval = read(tape, record, n);
- if (rval < 0)
+ if (rval == -1)
goto ioerror;
(void) snprintf(resp, sizeof resp, "A%d\n", rval);
(void) write(STDOUT_FILENO, resp, strlen(resp));