aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9p.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-08-10 18:54:14 +0000
committerrsc <devnull@localhost>2005-08-10 18:54:14 +0000
commita919ad8340ba788c54d34b437c347ee8b0a5e922 (patch)
tree7c46edbb05af74096a6c004a5dd769934e9144b7 /src/cmd/9p.c
parent17e9283bd8833da47aab4ccb66c3e965c947cffd (diff)
downloadplan9port-a919ad8340ba788c54d34b437c347ee8b0a5e922.tar.gz
plan9port-a919ad8340ba788c54d34b437c347ee8b0a5e922.tar.bz2
plan9port-a919ad8340ba788c54d34b437c347ee8b0a5e922.zip
set exit status
Diffstat (limited to 'src/cmd/9p.c')
-rw-r--r--src/cmd/9p.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cmd/9p.c b/src/cmd/9p.c
index 909bfeb6..bace6d09 100644
--- a/src/cmd/9p.c
+++ b/src/cmd/9p.c
@@ -355,13 +355,14 @@ dircmp(const void *va, const void *vb)
void
xls(int argc, char **argv)
{
- char *name, *xname, *f[4], buf[4096];
+ char *err, *name, *xname, *f[4], buf[4096];
int nf, i, j, l;
int lflag, dflag, n, len[4];
Dir *d;
CFid *fid;
CFsys *fs;
-
+
+ err = nil;
lflag = dflag = 0;
ARGBEGIN{
case 'l':
@@ -383,6 +384,7 @@ xls(int argc, char **argv)
if((d = fsdirstat(fs, xname)) == nil){
fprint(2, "dirstat %s: %r\n", name);
fsunmount(fs);
+ err = "errors";
continue;
}
if((d->mode&DMDIR) && !dflag){
@@ -390,6 +392,7 @@ xls(int argc, char **argv)
fprint(2, "open %s: %r\n", name);
fsunmount(fs);
free(d);
+ err = "errors";
continue;
}
free(d);
@@ -398,6 +401,7 @@ xls(int argc, char **argv)
if(n < 0){
fprint(2, "dirreadall %s: %r\n", name);
fsunmount(fs);
+ err = "errors";
continue;
}
qsort(d, n, sizeof d[0], dircmp);
@@ -430,6 +434,6 @@ xls(int argc, char **argv)
}
free(d);
}
- threadexitsall(0);
+ threadexitsall(err);
}