From 39f7ae0616a39ec19467b54157b3db58b2db4cca Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 7 Nov 2005 17:08:08 +0000 Subject: * times.cc (futimes): Redirect to utimes_worker if given file descriptor is opened R/O. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/times.cc | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) 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 + + * times.cc (futimes): Redirect to utimes_worker if given file + descriptor is opened R/O. + 2005-11-06 Christopher Faylor * 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; } -- cgit v1.2.3