aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-04-23 02:56:57 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-04-23 04:44:30 +1000
commita99a584694a222ca383ec47e5154b6edf4362585 (patch)
tree9fd5a175786d7d17ffc33987c7b50178dcb21b11 /libbb
parent014aabc8c0d20b8ab6e9af7f9234c76a46a3014f (diff)
downloadbusybox-w32-a99a584694a222ca383ec47e5154b6edf4362585.tar.gz
busybox-w32-a99a584694a222ca383ec47e5154b6edf4362585.tar.bz2
busybox-w32-a99a584694a222ca383ec47e5154b6edf4362585.zip
mingw_utime(): times can be NULL
Diffstat (limited to 'libbb')
-rw-r--r--libbb/mingw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libbb/mingw.c b/libbb/mingw.c
index 2839d9df6..e8195ade6 100644
--- a/libbb/mingw.c
+++ b/libbb/mingw.c
@@ -251,8 +251,10 @@ int mingw_utime (const char *file_name, const struct utimbuf *times)
251 if ((fh = open(file_name, O_RDWR | O_BINARY)) < 0) 251 if ((fh = open(file_name, O_RDWR | O_BINARY)) < 0)
252 return -1; 252 return -1;
253 253
254 time_t_to_filetime(times->modtime, &mft); 254 if (times) {
255 time_t_to_filetime(times->actime, &aft); 255 time_t_to_filetime(times->modtime, &mft);
256 time_t_to_filetime(times->actime, &aft);
257 }
256 if (!SetFileTime((HANDLE)_get_osfhandle(fh), NULL, &aft, &mft)) { 258 if (!SetFileTime((HANDLE)_get_osfhandle(fh), NULL, &aft, &mft)) {
257 errno = EINVAL; 259 errno = EINVAL;
258 rc = -1; 260 rc = -1;