more precision on time
This commit is contained in:
parent
a620761c92
commit
bb426e77f6
1 changed files with 7 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue