summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2008-06-10 22:28:26 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2008-06-10 22:28:26 +0000
commit43e7e776bc24c71b9ec1f603d930121569422ac6 (patch)
tree846cb5fcbe13827efd98bd9591943544194fb00d
parent5e8254de24c263322968a8925d4ae111feca4c9e (diff)
* fakeroot.c (netfs_attempt_utimes): Use a union to avoid an improper
cast.
-rw-r--r--trans/ChangeLog5
-rw-r--r--trans/fakeroot.c18
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