diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2012-05-08 08:30:30 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2012-05-08 08:30:30 +0000 |
commit | 9310c1fb44982fea5c678e8f2b2045619af9e4b7 (patch) | |
tree | 3b1dcceafbf8469bc7e1a4bb39adc2247763aa86 | |
parent | e218ba4a79993d6658b2e6d4559112e5a2887353 (diff) |
Really fixed utime()
-rw-r--r-- | src/htslib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/htslib.c b/src/htslib.c index 18a8f4e..f801d6d 100644 --- a/src/htslib.c +++ b/src/htslib.c @@ -2698,15 +2698,16 @@ static time_t getGMT(struct tm *tm) { /* hey, time_t is local! */ int set_filetime(const char* file, struct tm* tm_time) { time_t t = getGMT(tm_time); if (t != (time_t) -1) { - struct utimbuf tim; + STRUCT_UTIMBUF tim; memset(&tim, 0, sizeof(tim)); tim.actime = tim.modtime = t; - return utime(file, &tim); + return UTIME(file, &tim); } return -1; } /* sets file time from RFC822 date+time, -1 if error*/ +/* Note: utf-8 */ int set_filetime_rfc822(const char* file, const char* date) { struct tm buffer; struct tm* tm_s = convert_time_rfc822(&buffer, date); |