summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2022-07-30 16:09:27 +0000
committerOri Bernstein <ori@eigenstate.org>2022-07-30 16:09:27 +0000
commit30dcf55ee221b986aee6d428b4da431f6174c66b (patch)
treeadb2848544d8b55bbbc1c72e598cbfd276c17aac /sys
parent7a225e5331749e1c656661f7c1c5cc2767aa13d8 (diff)
bind, mount: stop returning mount id
The mount ID is a sequence number in a 32 bit integer, which means that it can't be unique. This is largely harmless, because there is no way to use the mount id, beyond checking if it's negative. However, there's no overflow check, so the mount ID can wrap negative, which will break error checks on mount calls. Because it's useless, let's just stop returning it.
Diffstat (limited to 'sys')
-rw-r--r--sys/man/2/bind3
-rw-r--r--sys/src/9/port/chan.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/sys/man/2/bind b/sys/man/2/bind
index 98feb41f7..5c0efeb94 100644
--- a/sys/man/2/bind
+++ b/sys/man/2/bind
@@ -224,8 +224,7 @@ is undone.
.IR mnt (3),
.IR srv (3)
.SH DIAGNOSTICS
-The return value is a positive integer (a unique sequence number) for
-success, -1 for failure.
+The return value is 0 for success, -1 for failure.
These routines set
.IR errstr .
.SH BUGS
diff --git a/sys/src/9/port/chan.c b/sys/src/9/port/chan.c
index 04d072ea4..c258e8f80 100644
--- a/sys/src/9/port/chan.c
+++ b/sys/src/9/port/chan.c
@@ -745,13 +745,12 @@ cmount(Chan *new, Chan *old, int flag, char *spec)
}
m->mount = nm;
}
- order = nm->mountid;
wunlock(&m->lock);
wunlock(&pg->ns);
mountfree(um);
- return order;
+ return 0;
}
void