aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9p.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-04 22:09:51 +0000
committerrsc <devnull@localhost>2005-01-04 22:09:51 +0000
commiteb423b5cc00a36f02129722e85e36eb9da1a60d3 (patch)
treef76ef7b7e580941987b060430735a764ac506777 /src/cmd/9p.c
parent3f54e7c8a49465f08e0012b0b84b175ee7c91b3b (diff)
downloadplan9port-eb423b5cc00a36f02129722e85e36eb9da1a60d3.tar.gz
plan9port-eb423b5cc00a36f02129722e85e36eb9da1a60d3.tar.bz2
plan9port-eb423b5cc00a36f02129722e85e36eb9da1a60d3.zip
use 9pclient instead of fs
Diffstat (limited to 'src/cmd/9p.c')
-rw-r--r--src/cmd/9p.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/src/cmd/9p.c b/src/cmd/9p.c
index 64f9b8c4..0f0a1a66 100644
--- a/src/cmd/9p.c
+++ b/src/cmd/9p.c
@@ -2,7 +2,7 @@
#include <signal.h>
#include <libc.h>
#include <fcall.h>
-#include <fs.h>
+#include <9pclient.h>
#include <thread.h>
char *addr;
@@ -72,12 +72,12 @@ threadmain(int argc, char **argv)
usage();
}
-Fsys*
+CFsys*
xparse(char *name, char **path)
{
int fd;
char *p;
- Fsys *fs;
+ CFsys *fs;
if(addr == nil){
p = strchr(name, '/');
@@ -100,24 +100,11 @@ xparse(char *name, char **path)
return fs;
}
-Fid*
-xwalk(char *name)
-{
- Fid *fid;
- Fsys *fs;
-
- fs = xparse(name, &name);
- fid = fswalk(fsroot(fs), name);
- if(fid == nil)
- sysfatal("fswalk %s: %r", name);
- return fid;
-}
-
-Fid*
+CFid*
xopen(char *name, int mode)
{
- Fid *fid;
- Fsys *fs;
+ CFid *fid;
+ CFsys *fs;
fs = xparse(name, &name);
fid = fsopen(fs, name, mode);
@@ -129,7 +116,7 @@ xopen(char *name, int mode)
int
xopenfd(char *name, int mode)
{
- Fsys *fs;
+ CFsys *fs;
fs = xparse(name, &name);
return fsopenfd(fs, name, mode);
@@ -140,7 +127,7 @@ xread(int argc, char **argv)
{
char buf[1024];
int n;
- Fid *fid;
+ CFid *fid;
ARGBEGIN{
default:
@@ -186,7 +173,7 @@ xwrite(int argc, char **argv)
{
char buf[1024];
int n, did;
- Fid *fid;
+ CFid *fid;
ARGBEGIN{
default:
@@ -240,7 +227,8 @@ void
xstat(int argc, char **argv)
{
Dir *d;
- Fid *fid;
+ CFsys *fs;
+ char *name;
ARGBEGIN{
default:
@@ -250,9 +238,10 @@ xstat(int argc, char **argv)
if(argc != 1)
usage();
- fid = xwalk(argv[0]);
- if((d = fsdirfstat(fid)) == 0)
- sysfatal("dirfstat: %r");
+ name = argv[0];
+ fs = xparse(name, &name);
+ if((d = fsdirstat(fs, name)) == 0)
+ sysfatal("dirstat: %r");
fmtinstall('D', dirfmt);
fmtinstall('M', dirmodefmt);
print("%D\n", d);