aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-02-02 09:46:52 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-02-02 09:46:52 +0000
commit29ce22c955f7a2cee33e9c465e4e7e0d043671bc (patch)
tree79568b9fbfe62351bd0a25086b5f11240486f8ba
parenta79f7ee05871b2ea3b23229f2003844d605f64ce (diff)
downloadnewlib-29ce22c955f7a2cee33e9c465e4e7e0d043671bc.zip
newlib-29ce22c955f7a2cee33e9c465e4e7e0d043671bc.tar.gz
newlib-29ce22c955f7a2cee33e9c465e4e7e0d043671bc.tar.bz2
* times.cc (utimes): Mark st_ctime for update according to SUSv3.
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/times.cc10
2 files changed, 11 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 9bea7c3..c222e98 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2005-02-02 Corinna Vinschen <corinna@vinschen.de>
+
+ * times.cc (utimes): Mark st_ctime for update according to SUSv3.
+
2005-02-01 Christopher Faylor <cgf@timesys.com>
* fhandler_proc.cc (format_proc_partitions): Remove PartitionType check
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index a6fac1a..4cdb4b2 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -1,6 +1,7 @@
/* times.cc
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005 Red Hat, Inc.
This file is part of Cygwin.
@@ -483,18 +484,21 @@ utimes (const char *path, struct timeval *tvp)
}
else
{
+ gettimeofday (&tmp[0], 0);
if (tvp == 0)
{
- gettimeofday (&tmp[0], 0);
tmp[1] = tmp[0];
tvp = tmp;
}
FILETIME lastaccess;
FILETIME lastwrite;
+ FILETIME lastchange;
timeval_to_filetime (tvp + 0, &lastaccess);
timeval_to_filetime (tvp + 1, &lastwrite);
+ /* Mark st_ctime for update */
+ timeval_to_filetime (tmp + 0, &lastchange);
debug_printf ("incoming lastaccess %08x %08x",
tvp->tv_sec,
@@ -507,7 +511,7 @@ utimes (const char *path, struct timeval *tvp)
on the file whose time is being modified. So calls to utime()
fail for read only files. */
- if (!SetFileTime (h, 0, &lastaccess, &lastwrite))
+ if (!SetFileTime (h, &lastchange, &lastaccess, &lastwrite))
{
__seterrno ();
res = -1;