summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/times.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/times.cc')
-rw-r--r--winsup/cygwin/times.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index f75bc2a0e..ee5fe5f50 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -56,7 +56,7 @@ times (struct tms * buf)
/* Ticks is in milliseconds, convert to our ticks. Use long long to prevent
overflow. */
clock_t tc = (clock_t) ((long long) ticks * CLOCKS_PER_SEC / 1000);
- if (iswinnt)
+ if (wincap.has_get_process_times ())
{
GetProcessTimes (hMainProc, &creation_time, &exit_time,
&kernel_time, &user_time);
@@ -462,7 +462,8 @@ utimes (const char *path, struct timeval *tvp)
/* Note: It's not documented in MSDN that FILE_WRITE_ATTRIBUTES is
sufficient to change the timestamps... */
HANDLE h = CreateFileA (win32.get_win32 (),
- iswinnt ? FILE_WRITE_ATTRIBUTES : GENERIC_WRITE,
+ wincap.has_specific_access_rights () ?
+ FILE_WRITE_ATTRIBUTES : GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
&sec_none_nih,
OPEN_EXISTING,