On Sun, Sep 20, 2026 at 4:09 PM Richard Henderson <
[email protected]> wrote:

> On 9/19/26 19:20, Warner Losh wrote:
> > +++ b/bsd-user/mmap.c
> > @@ -215,10 +215,13 @@ static int mmap_frag(abi_ulong real_start,
> >
> >       prot_new = prot | prot1;
> >       if (fd != -1) {
> > -        /* msync() won't work here, so we return an error if write is
> > -           possible while it is a shared mapping */
> > -        if ((flags & TARGET_BSD_MAP_FLAGMASK) == MAP_SHARED &&
> > -            (prot & PROT_WRITE))
> > +        /*
> > +         * msync() won't work here, so we return an error if write is
> > +         * possible while it is a shared mapping
> > +         */
> > +        if (!(flags & MAP_ANON)
> > +            && (flags & MAP_TYPE) == MAP_SHARED
> > +            && (prot & PROT_WRITE))
> >               return -1;
> >
> >           /* adjust protection to be able to read */
>
> Need braces, even if they were missing beforehand.  Otherwise,
>

OK. I'll fix this for this series, but I'm tempted to land my 'fix all the
style bugs in bsd-user' patches
since this issue stubs my toe all the time.


> Reviewed-by: Richard Henderson <[email protected]>
>

Thanks!


> r~
>

Reply via email to