summaryrefslogtreecommitdiff
path: root/sys/src/cmd/scat
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-05-02 17:32:01 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2020-05-02 17:32:01 +0200
commitac88ce4f7f19be1aae1fdf390fa870b4be8dc3f5 (patch)
tree47df6acf41dd8d2dc607b89af9d4667935d0c952 /sys/src/cmd/scat
parent7ff6ea0f70307d4b82e6df69eb1310a6e27aa4ad (diff)
make bind(2) error handling consistent
The mount() and bind() syscalls return -1 on error, and the mountid sequence number on success. The manpage states that the mountid sequence number is a positive integer, but the kernels implementation currently uses a unsigned 32-bit integer and does not guarantee that the mountid will not become negative. Most code just cares about the error, so test for the -1 error value only.
Diffstat (limited to 'sys/src/cmd/scat')
-rw-r--r--sys/src/cmd/scat/header.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/cmd/scat/header.c b/sys/src/cmd/scat/header.c
index 17955ecea..562998119 100644
--- a/sys/src/cmd/scat/header.c
+++ b/sys/src/cmd/scat/header.c
@@ -274,7 +274,7 @@ loop:
/*
* mount nfs jukebox server
*/
- if(mount(s1, -1, "/n/njuke", 0, "") < 0) {
+ if(mount(s1, -1, "/n/njuke", 0, "") == -1) {
close(s1);
Bprint(&bout, "\"mount /srv/%s /n/juke\" failed: %r\n", JUKEFS);
goto out;
@@ -300,7 +300,7 @@ loop:
/*
* mount 9660 server
*/
- if(mount(s2, -1, "/n/dss", 0, dssname) < 0) {
+ if(mount(s2, -1, "/n/dss", 0, dssname) == -1) {
close(s2);
if(count == 0) {
// do it again so /n/njuke is in 9660's namespace