Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-11-07 20:08:08 +0300
committerCorinna Vinschen <corinna@vinschen.de>2005-11-07 20:08:08 +0300
commit39f7ae0616a39ec19467b54157b3db58b2db4cca (patch)
tree5d2e380eab6919da09ed68f55dcfa07e82c6402d
parent835cc311c3e01c672c12132b88b34c28f8a8524d (diff)
* times.cc (futimes): Redirect to utimes_worker if given file
descriptor is opened R/O.
-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;
}