Re: [PATCH for 6.2 12/49] bsd-user: implement path searching

2021-08-08 Thread Warner Losh
On Sat, Aug 7, 2021 at 11:49 PM Kyle Evans wrote: > On Sat, Aug 7, 2021 at 10:11 PM Richard Henderson > wrote: > > > > On 8/7/21 11:42 AM, Warner Losh wrote: > > > +path = g_strdup(p); > > > +if (path == NULL) { > > > > Only returns null when the input is null, which you've alrea

Re: [PATCH for 6.2 12/49] bsd-user: implement path searching

2021-08-07 Thread Kyle Evans
On Sat, Aug 7, 2021 at 10:11 PM Richard Henderson wrote: > > On 8/7/21 11:42 AM, Warner Losh wrote: > > +path = g_strdup(p); > > +if (path == NULL) { > > Only returns null when the input is null, which you've already eliminated. > > > +static bool find_in_path(char *path, const cha

Re: [PATCH for 6.2 12/49] bsd-user: implement path searching

2021-08-07 Thread Richard Henderson
On 8/7/21 11:42 AM, Warner Losh wrote: +path = g_strdup(p); +if (path == NULL) { Only returns null when the input is null, which you've already eliminated. +static bool find_in_path(char *path, const char *filename, char *retpath, + size_t rpsize) +{ +

[PATCH for 6.2 12/49] bsd-user: implement path searching

2021-08-07 Thread Warner Losh
Use the PATH to find the executable given a bare argument. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 73 +- bsd-user/qemu.h| 3 +- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/bsd-user/bsdloa