All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-devel] [PATCH] mdadm: fix compilation failure on the x32 ABI
@ 2022-11-04 14:01 ` Mikulas Patocka
  0 siblings, 0 replies; 6+ messages in thread
From: Mikulas Patocka @ 2022-11-04 14:01 UTC (permalink / raw)
  To: NeilBrown, Jes Sorensen
  Cc: linux-raid, Song Liu, dm-devel, Guoqing Jiang, Zdenek Kabelac

Hi

Here I'm sending a patch for the mdadm utility. It fixes compile failure 
on the x32 ABI.

Mikulas


From: Mikulas Patocka <mpatocka@redhat.com>

The x32 ABI has 32-bit long and 64-bit time_t. Consequently, it reports 
printf arguments mismatch when attempting to print time using the "%ld" 
format specifier.

Fix this by converting times to long long and using %lld when printing
them.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 monitor.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: mdadm/monitor.c
===================================================================
--- mdadm.orig/monitor.c	2022-11-04 14:25:52.000000000 +0100
+++ mdadm/monitor.c	2022-11-04 14:28:05.000000000 +0100
@@ -449,9 +449,9 @@ static int read_and_act(struct active_ar
 	}
 
 	gettimeofday(&tv, NULL);
-	dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
+	dprintf("(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s start:%llu\n",
 		a->info.container_member,
-		tv.tv_sec, tv.tv_usec,
+		(long long)tv.tv_sec, (long long)tv.tv_usec,
 		array_states[a->curr_state],
 		array_states[a->prev_state],
 		sync_actions[a->curr_action],

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-18  8:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-04 14:01 [dm-devel] [PATCH] mdadm: fix compilation failure on the x32 ABI Mikulas Patocka
2022-11-04 14:01 ` Mikulas Patocka
2022-11-17 14:28 ` [dm-devel] " Mariusz Tkaczyk
2022-11-17 14:28   ` Mariusz Tkaczyk
2022-11-17 14:51   ` [dm-devel] " Jes Sorensen
2022-11-17 14:51     ` Jes Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.