diff options
Diffstat (limited to 'win32/mingw.c')
-rw-r--r-- | win32/mingw.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index c52df4bb4..2645aadca 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -366,17 +366,17 @@ static inline void timeval_to_filetime(const struct timeval tv, FILETIME *ft) | |||
366 | ft->dwHighDateTime = winTime >> 32; | 366 | ft->dwHighDateTime = winTime >> 32; |
367 | } | 367 | } |
368 | 368 | ||
369 | int utimes(const char *file_name, const struct timeval times[2]) | 369 | int utimes(const char *file_name, const struct timeval tims[2]) |
370 | { | 370 | { |
371 | FILETIME mft, aft; | 371 | FILETIME mft, aft; |
372 | HANDLE fh; | 372 | HANDLE fh; |
373 | DWORD flags; | 373 | DWORD flags, attrs; |
374 | int rc; | 374 | int rc; |
375 | 375 | ||
376 | flags = FILE_ATTRIBUTE_NORMAL; | 376 | flags = FILE_ATTRIBUTE_NORMAL; |
377 | 377 | ||
378 | /* must have write permission */ | 378 | /* must have write permission */ |
379 | DWORD attrs = GetFileAttributes(file_name); | 379 | attrs = GetFileAttributes(file_name); |
380 | if ( attrs != INVALID_FILE_ATTRIBUTES ) { | 380 | if ( attrs != INVALID_FILE_ATTRIBUTES ) { |
381 | if ( attrs & FILE_ATTRIBUTE_READONLY ) { | 381 | if ( attrs & FILE_ATTRIBUTE_READONLY ) { |
382 | /* ignore errors here; open() will report them */ | 382 | /* ignore errors here; open() will report them */ |
@@ -397,9 +397,9 @@ int utimes(const char *file_name, const struct timeval times[2]) | |||
397 | goto revert_attrs; | 397 | goto revert_attrs; |
398 | } | 398 | } |
399 | 399 | ||
400 | if (times) { | 400 | if (tims) { |
401 | timeval_to_filetime(times[0], &aft); | 401 | timeval_to_filetime(tims[0], &aft); |
402 | timeval_to_filetime(times[1], &mft); | 402 | timeval_to_filetime(tims[1], &mft); |
403 | } | 403 | } |
404 | else { | 404 | else { |
405 | GetSystemTimeAsFileTime(&mft); | 405 | GetSystemTimeAsFileTime(&mft); |
@@ -566,7 +566,7 @@ struct passwd *getpwuid(int uid UNUSED_PARAM) | |||
566 | if (!GetUserName(user_name, &len)) | 566 | if (!GetUserName(user_name, &len)) |
567 | return NULL; | 567 | return NULL; |
568 | p.pw_name = user_name; | 568 | p.pw_name = user_name; |
569 | p.pw_gecos = "unknown"; | 569 | p.pw_gecos = (char *)"unknown"; |
570 | p.pw_dir = gethomedir(); | 570 | p.pw_dir = gethomedir(); |
571 | p.pw_shell = NULL; | 571 | p.pw_shell = NULL; |
572 | p.pw_uid = 1000; | 572 | p.pw_uid = 1000; |
@@ -811,7 +811,7 @@ int mingw_unlink(const char *pathname) | |||
811 | } | 811 | } |
812 | 812 | ||
813 | #undef strftime | 813 | #undef strftime |
814 | size_t mingw_strftime(const char *buf, size_t max, const char *format, const struct tm *tm) | 814 | size_t mingw_strftime(char *buf, size_t max, const char *format, const struct tm *tm) |
815 | { | 815 | { |
816 | size_t ret; | 816 | size_t ret; |
817 | char day[3]; | 817 | char day[3]; |
@@ -846,7 +846,7 @@ size_t mingw_strftime(const char *buf, size_t max, const char *format, const str | |||
846 | return ret; | 846 | return ret; |
847 | } | 847 | } |
848 | 848 | ||
849 | int stime(time_t *t) | 849 | int stime(time_t *t UNUSED_PARAM) |
850 | { | 850 | { |
851 | errno = EPERM; | 851 | errno = EPERM; |
852 | return -1; | 852 | return -1; |