qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 08/12] linux-user: factor out reading of /proc/self/maps


From: Alex Bennée
Subject: Re: [PATCH v3 08/12] linux-user: factor out reading of /proc/self/maps
Date: Mon, 06 Apr 2020 10:09:19 +0100
User-agent: mu4e 1.3.10; emacs 28.0.50

Richard Henderson <address@hidden> writes:

> On 4/3/20 12:11 PM, Alex Bennée wrote:
>> +                e->is_read  = fields[1][0] == 'r' ? true : false;
>> +                e->is_write = fields[1][1] == 'w' ? true : false;
>> +                e->is_exec  = fields[1][2] == 'x' ? true : false;
>> +                e->is_priv  = fields[1][3] == 'p' ? true : false;
>
> Drop the redundant ? true : false.  That is of course the result of the 
> boolean
> operation.

doh! Fortunately the compiler was smart enough to see through my idiocy...

>
>> +                errors += qemu_strtoi(fields[4], NULL, 10, &e->inode);
>
> The root of the typedef chain for ino_t is
>
> /usr/include/asm-generic/posix_types.h:typedef __kernel_ulong_t 
> __kernel_ino_t;
>
> so I think you should just go ahead and use unsigned long here too.  Or maybe
> even uint64_t, because 32-bit has ino64_t, and could in fact have a Large
> Number here.

Will fix.

>
>
> r~


-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]