Re: [RFC PATCH] linux-user: glib-ify is_proc_myself

2021-05-24 Thread Richard Henderson
On 5/24/21 4:23 AM, Alex Bennée wrote: +} else if (g_ascii_isdigit(*filename)) { +g_autofree char * myself = g_strdup_printf("%d/", getpid()); +if (!g_str_has_prefix(filename, myself)) { This seems roundabout. Wouldn't it be better to qemu_strtoul and compare th

Re: [RFC PATCH] linux-user: glib-ify is_proc_myself

2021-05-24 Thread Alex Bennée
Daniel P. Berrangé writes: > On Mon, May 24, 2021 at 12:23:23PM +0100, Alex Bennée wrote: >> I'm not sure if this is neater than the original code but it does >> remove a bunch of the !strcmp's in favour of glib's more natural bool >> results. While we are at it make the function a bool return

Re: [RFC PATCH] linux-user: glib-ify is_proc_myself

2021-05-24 Thread Daniel P . Berrangé
On Mon, May 24, 2021 at 12:23:23PM +0100, Alex Bennée wrote: > I'm not sure if this is neater than the original code but it does > remove a bunch of the !strcmp's in favour of glib's more natural bool > results. While we are at it make the function a bool return and fixup > the fake_open function p

Re: [RFC PATCH] linux-user: glib-ify is_proc_myself

2021-05-24 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210524112323.2310-1-alex.ben...@linaro.org/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210524112323.2310-1-alex.ben...@linaro.org Subject: [RFC PATCH] linux-user: glib-ify

[RFC PATCH] linux-user: glib-ify is_proc_myself

2021-05-24 Thread Alex Bennée
I'm not sure if this is neater than the original code but it does remove a bunch of the !strcmp's in favour of glib's more natural bool results. While we are at it make the function a bool return and fixup the fake_open function prototypes. Signed-off-by: Alex Bennée --- linux-user/syscall.c | 3