diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-05-01 19:58:58 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-05-01 19:58:58 +0200 |
commit | ee289c241577a3553bfd73211cd81e137ab4fe40 (patch) | |
tree | 8f40ebfb2769de543c133120c5dbc468beddc9eb /sys/src/lib9p/mount.c | |
parent | 57c21ae441d1b6af38ce310ffec87340488ed84b (diff) |
lib9p: remove Srv.srvfd, make postsrv() and threadpostsrv() return the mountable file descriptor, update documentation
Now that we have these new functions,
we can also make them return an error
instead of calling sysfatal() like
postmountsrv().
Remove the confusing Srv.srvfd, as it
is only temporarily used and return
it from postsrv() instead.
Diffstat (limited to 'sys/src/lib9p/mount.c')
-rw-r--r-- | sys/src/lib9p/mount.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/src/lib9p/mount.c b/sys/src/lib9p/mount.c index 1adc90bed..1ab41825c 100644 --- a/sys/src/lib9p/mount.c +++ b/sys/src/lib9p/mount.c @@ -8,12 +8,15 @@ void postmountsrv(Srv *s, char *name, char *mtpt, int flag) { - postsrv(s, name); + int sfd; + sfd = postsrv(s, name); + if(sfd < 0) + sysfatal("postsrv: %r"); if(mtpt != nil){ - if(amount(s->srvfd, mtpt, flag, "") == -1) + if(amount(sfd, mtpt, flag, "") == -1) sysfatal("mount %s: %r", mtpt); - /* mount closed s->srvfd */ + /* mount closed sfd */ } else - close(s->srvfd); + close(sfd); } |