cifs: fix timezone for timestamps
tm2sec() ignores tm.tzoff and will use the local timezone for conversion. to make it work right, we convert the dos timestamp as GMT and then correct timezone with the offset provided by the server.
This commit is contained in:
parent
c7b56cfe58
commit
9fb29e09ea
1 changed files with 3 additions and 3 deletions
|
@ -401,17 +401,17 @@ gdatetime(Pkt *p)
|
|||
d = gl16(p);
|
||||
}
|
||||
|
||||
memset(&tm, 0, sizeof(tm));
|
||||
tm.year = 80 + (d >> 9);
|
||||
tm.mon = ((d >> 5) & 017) - 1;
|
||||
tm.mday = d & 037;
|
||||
tm.zone[0] = 0;
|
||||
tm.tzoff = p->s->tz;
|
||||
|
||||
tm.hour = t >> 11;
|
||||
tm.min = (t >> 5) & 63;
|
||||
tm.sec = (t & 31) << 1;
|
||||
strcpy(tm.zone, "GMT");
|
||||
|
||||
return tm2sec(&tm);
|
||||
return tm2sec(&tm) + p->s->tz;
|
||||
}
|
||||
|
||||
long
|
||||
|
|
Loading…
Reference in a new issue