summaryrefslogtreecommitdiff
blob: 59333feb0be7c0f6310db76c3713869cc29d34c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
http://bugs.gentoo.org/256784

From 060292366348d55eb90b5c3f4f15768ffc7639d2 Mon Sep 17 00:00:00 2001
From: nekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Date: Sun, 7 Sep 2008 00:05:38 +0000
Subject: [PATCH] 	* libmisc/copydir.c, configure.in: Check for the presence of
 	st_mtim and st_mtimensec, as for st_atim and st_atimensec.

git-svn-id: svn://svn.debian.org/pkg-shadow/upstream/trunk@2364 5a98b0ae-9ef6-0310-add3-de5d479b70d7
---
 ChangeLog         |    5 +++++
 configure.in      |    2 ++
 libmisc/copydir.c |   17 ++++++++++++-----
 3 files changed, 19 insertions(+), 5 deletions(-)

+2008-09-07  Nicolas François  <nicolas.francois@centraliens.net>
+
+	* libmisc/copydir.c, configure.in: Check for the presence of
+	st_mtim and st_mtimensec, as for st_atim and st_atimensec.

/* configure.in changes are in the 4.1.2.2 configure.in ... */
 
diff --git a/libmisc/copydir.c b/libmisc/copydir.c
index cdd2037..a9aec98 100644
--- a/libmisc/copydir.c
+++ b/libmisc/copydir.c
@@ -288,19 +288,26 @@ static int copy_entry (const char *src, const char *dst,
 	if (LSTAT (src, &sb) == -1) {
 		/* If we cannot stat the file, do not care. */
 	} else {
-#ifdef	HAVE_STRUCT_STAT_ST_ATIM
+#ifdef HAVE_STRUCT_STAT_ST_ATIM
 		mt[0].tv_sec  = sb.st_atim.tv_sec;
 		mt[0].tv_usec = sb.st_atim.tv_nsec / 1000;
-		mt[1].tv_sec  = sb.st_mtim.tv_sec;
-		mt[1].tv_usec = sb.st_mtim.tv_nsec / 1000;
 #else
 		mt[0].tv_sec  = sb.st_atime;
-		mt[1].tv_sec  = sb.st_mtime;
 #ifdef HAVE_STRUCT_STAT_ST_ATIMENSEC
 		mt[0].tv_usec = sb.st_atimensec / 1000;
-		mt[1].tv_usec = sb.st_mtimensec / 1000;
 #else
 		mt[0].tv_usec = 0;
+#endif
+#endif
+
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
+		mt[1].tv_sec  = sb.st_mtim.tv_sec;
+		mt[1].tv_usec = sb.st_mtim.tv_nsec / 1000;
+#else
+		mt[1].tv_sec  = sb.st_mtime;
+#ifdef HAVE_STRUCT_STAT_ST_MTIMENSEC
+		mt[1].tv_usec = sb.st_mtimensec / 1000;
+#else
 		mt[1].tv_usec = 0;
 #endif
 #endif
-- 
1.6.1.2