diff options
-rw-r--r-- | trans/ChangeLog | 5 | ||||
-rw-r--r-- | trans/fakeroot.c | 18 |
2 files changed, 16 insertions, 7 deletions
diff --git a/trans/ChangeLog b/trans/ChangeLog index 93c91df6..c33c4895 100644 --- a/trans/ChangeLog +++ b/trans/ChangeLog @@ -1,3 +1,8 @@ +2008-06-10 Samuel Thibault <samuel.thibault@ens-lyon.org> + + * fakeroot.c (netfs_attempt_utimes): Use a union to avoid an improper + cast. + 2007-06-06 Thomas Schwinge <tschwinge@gnu.org> * Makefile (default_pager-MIGCOMSFLAGS): Remove variable. diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 6f1cd748..ab2cff8a 100644 --- a/trans/fakeroot.c +++ b/trans/fakeroot.c @@ -502,22 +502,26 @@ error_t netfs_attempt_utimes (struct iouser *cred, struct node *np, struct timespec *atime, struct timespec *mtime) { - struct timeval a, m; + union tv + { + struct timeval tv; + time_value_t tvt; + } + union tv a, m; if (atime) { - TIMESPEC_TO_TIMEVAL (&a, atime); + TIMESPEC_TO_TIMEVAL (&a.tv, atime); } else - a.tv_sec = a.tv_usec = -1; + a.tv.tv_sec = a.tv.tv_usec = -1; if (mtime) { - TIMESPEC_TO_TIMEVAL (&m, mtime); + TIMESPEC_TO_TIMEVAL (&m.tv, mtime); } else - m.tv_sec = m.tv_usec = -1; + m.tv.tv_sec = m.tv.tv_usec = -1; - return file_utimes (np->nn->file, - *(time_value_t *) &a, *(time_value_t *) &m); + return file_utimes (np->nn->file, &a.tvt, &m.tvt); } error_t |