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: Richard Henderson
Subject: Re: [PATCH v3 08/12] linux-user: factor out reading of /proc/self/maps
Date: Fri, 3 Apr 2020 17:33:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

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.

> +                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.


r~



reply via email to

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