summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a146392)
raw | patch | inline | side by side (parent: a146392)
author | SZEDER Gábor <szeder@ira.uka.de> | |
Mon, 12 Jul 2010 23:42:03 +0000 (01:42 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 13 Jul 2010 00:34:46 +0000 (17:34 -0700) |
POSIX sayeth:
"If times is a null pointer, the access and modification
times of the file shall be set to the current time."
Let's do so.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
"If times is a null pointer, the access and modification
times of the file shall be set to the current time."
Let's do so.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index 9a8e3365827d303c6513475726113a3952fe0040..24333cb167f785cbcf29775eec1237259221e89c 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
goto revert_attrs;
}
- time_t_to_filetime(times->modtime, &mft);
- time_t_to_filetime(times->actime, &aft);
+ if (times) {
+ time_t_to_filetime(times->modtime, &mft);
+ time_t_to_filetime(times->actime, &aft);
+ } else {
+ GetSystemTimeAsFileTime(&mft);
+ aft = mft;
+ }
if (!SetFileTime((HANDLE)_get_osfhandle(fh), NULL, &aft, &mft)) {
errno = EINVAL;
rc = -1;