aboutsummaryrefslogtreecommitdiff
path: root/src/lib9pclient/close.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-04 21:22:40 +0000
committerrsc <devnull@localhost>2005-01-04 21:22:40 +0000
commit46f79934b79ef526ed42bbe5a565e6b5d884d24a (patch)
treed1e663f7d3b2b328f03aeb34fdb3f4006aa97ec0 /src/lib9pclient/close.c
parent5ba841dffa1f6cda712ebcff27c55c9d0a672c67 (diff)
downloadplan9port-46f79934b79ef526ed42bbe5a565e6b5d884d24a.tar.gz
plan9port-46f79934b79ef526ed42bbe5a565e6b5d884d24a.tar.bz2
plan9port-46f79934b79ef526ed42bbe5a565e6b5d884d24a.zip
lib9pclient is the new libfs
Diffstat (limited to 'src/lib9pclient/close.c')
-rw-r--r--src/lib9pclient/close.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib9pclient/close.c b/src/lib9pclient/close.c
new file mode 100644
index 00000000..98c6cfb2
--- /dev/null
+++ b/src/lib9pclient/close.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2003 Russ Cox, Massachusetts Institute of Technology */
+/* See COPYRIGHT */
+
+#include <u.h>
+#include <libc.h>
+#include <fcall.h>
+#include <9pclient.h>
+#include "fsimpl.h"
+
+static void
+fidclunk(CFid *fid)
+{
+ Fcall tx, rx;
+
+ tx.type = Tclunk;
+ tx.fid = fid->fid;
+ _fsrpc(fid->fs, &tx, &rx, 0);
+ _fsputfid(fid);
+}
+
+void
+fsclose(CFid *fid)
+{
+ if(fid == nil)
+ return;
+
+ /* maybe someday there will be a ref count */
+ fidclunk(fid);
+}