aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9pserve.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-06 23:11:14 +0000
committerrsc <devnull@localhost>2005-01-06 23:11:14 +0000
commitbb426e77f62a2f190de7e8d63ceb2e13e17194d4 (patch)
treee2d7686ffbe621b1a324e8ad9e29ad9938130d8d /src/cmd/9pserve.c
parenta620761c92f49d2738f99fab206a4c61a89394cf (diff)
downloadplan9port-bb426e77f62a2f190de7e8d63ceb2e13e17194d4.tar.gz
plan9port-bb426e77f62a2f190de7e8d63ceb2e13e17194d4.tar.bz2
plan9port-bb426e77f62a2f190de7e8d63ceb2e13e17194d4.zip
more precision on time
Diffstat (limited to 'src/cmd/9pserve.c')
-rw-r--r--src/cmd/9pserve.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cmd/9pserve.c b/src/cmd/9pserve.c
index 5413ba2e..7ff30ef8 100644
--- a/src/cmd/9pserve.c
+++ b/src/cmd/9pserve.c
@@ -1129,10 +1129,12 @@ mwrite9p(Ioproc *io, int fd, uchar *pkt)
n = GBIT32(pkt);
if(verbose > 2) fprint(2, "%T write %d %d %.*H\n", fd, n, n, pkt);
+if(verbose > 1) fprint(2, "%T before iowrite\n");
if(iowrite(io, fd, pkt, n) != n){
fprint(2, "%T write error: %r\n");
return -1;
}
+if(verbose > 1) fprint(2, "%T after iowrite\n");
if(pkt[4] == Ropenfd){
nfd = GBIT32(pkt+n-4);
if(iosendfd(io, fd, nfd) < 0){
@@ -1244,8 +1246,11 @@ timefmt(Fmt *fmt)
{
static char *mon[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+ vlong ns;
Tm tm;
+ ns = nsec();
tm = *localtime(time(0));
- return fmtprint(fmt, "%s %2d %02d:%02d:%02d",
- mon[tm.mon], tm.mday, tm.hour, tm.min, tm.sec);
+ return fmtprint(fmt, "%s %2d %02d:%02d:%02d.%03d",
+ mon[tm.mon], tm.mday, tm.hour, tm.min, tm.sec,
+ (int)(ns%1000000000)/1000000);
}