diff options
author | rsc <devnull@localhost> | 2004-05-11 17:51:27 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-05-11 17:51:27 +0000 |
commit | c4097c29512269f4547ebefb8abdc57a2892b479 (patch) | |
tree | e84c61a845b196bfa903088e15b772ae0b16c8bb /src/cmd | |
parent | 2f2df5e02ef22c9727ae2b8269d5c76a061d296f (diff) | |
download | plan9port-c4097c29512269f4547ebefb8abdc57a2892b479.tar.gz plan9port-c4097c29512269f4547ebefb8abdc57a2892b479.tar.bz2 plan9port-c4097c29512269f4547ebefb8abdc57a2892b479.zip |
Fix small bugs.
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/ls.C | 2 | ||||
-rw-r--r-- | src/cmd/rc/plan9ish.c | 2 | ||||
-rw-r--r-- | src/cmd/time.c | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/cmd/ls.C b/src/cmd/ls.C index de2bee94..8bdeab61 100644 --- a/src/cmd/ls.C +++ b/src/cmd/ls.C @@ -101,6 +101,8 @@ ls(char *s, int multi) return 1; } if(db->qid.type&QTDIR && dflag==0){ + free(db); + db = nil; output(); fd = open(s, OREAD); if(fd == -1) diff --git a/src/cmd/rc/plan9ish.c b/src/cmd/rc/plan9ish.c index 2b9011cc..6644778c 100644 --- a/src/cmd/rc/plan9ish.c +++ b/src/cmd/rc/plan9ish.c @@ -71,7 +71,7 @@ void Vinit(void){ for(s=*env;*s && *s!='(' && *s!='=';s++); switch(*s){ case '\0': - pfmt(err, "rc: odd environment %q?\n", *env); + // pfmt(err, "rc: odd environment %q?\n", *env); break; case '=': *s='\0'; diff --git a/src/cmd/time.c b/src/cmd/time.c index d82eaa94..3b52216b 100644 --- a/src/cmd/time.c +++ b/src/cmd/time.c @@ -11,6 +11,7 @@ main(int argc, char *argv[]) { int i; Waitmsg *w; + vlong t0, t1; long l; char *p; char err[ERRMAX]; @@ -20,6 +21,7 @@ main(int argc, char *argv[]) exits("usage"); } + t0 = nsec(); switch(fork()){ case -1: error("fork"); @@ -37,8 +39,9 @@ main(int argc, char *argv[]) loop: w = wait(); + t1 = nsec(); if(w == nil){ - errstr(err, sizeof err); + rerrstr(err, sizeof err); if(strcmp(err, "interrupted") == 0) goto loop; error("wait"); @@ -47,7 +50,7 @@ main(int argc, char *argv[]) add("%ld.%.2ldu", l/1000, (l%1000)/10); l = w->time[1]; add("%ld.%.2lds", l/1000, (l%1000)/10); - l = w->time[2]; + l = (t1-t0)/1000000; add("%ld.%.2ldr", l/1000, (l%1000)/10); add("\t"); for(i=1; i<argc; i++){ |