From 43e7e776bc24c71b9ec1f603d930121569422ac6 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 10 Jun 2008 22:28:26 +0000 Subject: * fakeroot.c (netfs_attempt_utimes): Use a union to avoid an improper cast. --- trans/fakeroot.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'trans/fakeroot.c') 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 -- cgit v1.2.3