Skip to content

Commit 130cc9d

Browse files
committed
Merge pull request #1927 from johnelse/ca-145257-master
CA-145257: Set the right month for host_crashdump.
2 parents bfd9bd9 + c89dafb commit 130cc9d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ocaml/xapi/xapi_host_crashdump.ml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,10 @@ let resynchronise ~__context ~host =
8686
| size :: _ -> Int64.of_string size
8787
| _ -> (-1L) in
8888
let timestamp =
89+
let open Unix in
8990
try Scanf.sscanf filename "%04d%02d%02d-%02d%02d%02d-UTC"
90-
(fun tm_year tm_mon tm_mday tm_hour tm_min tm_sec ->
91-
fst (Unix.mktime
92-
{ Unix.tm_year=tm_year-1900; tm_mon; tm_mday;
93-
tm_hour; tm_min; tm_sec; tm_wday=0; tm_yday=0; tm_isdst=false }))
91+
(fun year mon tm_mday tm_hour tm_min tm_sec ->
92+
fst ( mktime {tm_year=year-1900; tm_mon=mon-1; tm_mday; tm_hour; tm_min; tm_sec; tm_wday=0; tm_yday=0; tm_isdst=false}))
9493
with _ ->
9594
(Unix.stat (Filename.concat crash_dir filename)).Unix.st_ctime in
9695
let timestamp = Date.of_float timestamp in

0 commit comments

Comments
 (0)