summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/times.cc4
2 files changed, 8 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 8b5f8db82..ccdd250cd 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * times.cc (futimes): Redirect to utimes_worker if given file
+ descriptor is opened R/O.
+
2005-11-06 Christopher Faylor <cgf@timesys.com>
* dcrt0.cc (dll_crt0_0): Initialize security data first so that it can
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index 22bd79684..3d762464f 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -513,8 +513,10 @@ futimes (int fd, const struct timeval *tvp)
cygheap_fdget cfd (fd);
if (cfd < 0)
res = -1;
- else
+ else if (cfd->get_access () & (FILE_WRITE_ATTRIBUTES | GENERIC_WRITE))
res = cfd->utimes (tvp);
+ else
+ res = utimes_worker (cfd->get_win32_name (), tvp, 1);
syscall_printf ("%d = futimes (%d, %p)", res, fd, tvp);
return res;
}