Re: [PATCH] mdadm: fix compilation failure on the x32 ABI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/17/22 09:28, Mariusz Tkaczyk wrote:
> On Fri, 4 Nov 2022 10:01:22 -0400 (EDT)
> Mikulas Patocka <mpatocka@xxxxxxxxxx> wrote:
> 
>> Hi
>>
>> Here I'm sending a patch for the mdadm utility. It fixes compile failure 
>> on the x32 ABI.
>>
>> Mikulas
>>
>>
>> From: Mikulas Patocka <mpatocka@xxxxxxxxxx>
>>
>> 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@xxxxxxxxxx>
>>
>> ---
>>  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],
>>
> Hi Mikulas,
> This is just a debug log in mdmon, feel free to remove the time totally.

I second this! :)

Jes


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




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux