forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-02-13 e440ec23c5a540cdd3f7464e8779219be6fd3d95
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
From e37f7f6a0f1ef1b594574d11a8b90b8c861d047b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
Date: Sun, 15 Mar 2015 09:02:14 +0000
Subject: [PATCH] mdadm: Fix build in x32 ABI
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
 
When try to print time_t values as a long int it causes an error because time_t
data type in x32 ABI is long long int.
 
Upstream-Status: Pending
 
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
 
---
 monitor.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
 
diff --git a/monitor.c b/monitor.c
index 81537ed..7c33382 100644
--- a/monitor.c
+++ b/monitor.c
@@ -445,9 +445,12 @@ static int read_and_act(struct active_array *a, fd_set *fds)
         if (FD_ISSET(mdi->bb_fd, fds))
             check_for_cleared_bb(a, mdi);
     }
-
     gettimeofday(&tv, NULL);
+#if defined(__x86_64__) && defined(__ILP32__)
+    dprintf("(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s start:%llu\n",
+#else
     dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
+#endif
         a->info.container_member,
         tv.tv_sec, tv.tv_usec,
         array_states[a->curr_state],