[oe] [meta-oe][PATCH] xterm: Fix latent issue found with musl

Khem Raj raj.khem at gmail.com
Fri Dec 13 21:55:33 UTC 2019


On Thu, Dec 12, 2019 at 8:37 PM Adrian Bunk <bunk at stusta.de> wrote:
>
> On Thu, Dec 12, 2019 at 12:22:52PM -0800, Khem Raj wrote:
> >...
> > +Upstream-Status: Pending
>
> Not upstreamed OE-only musl patches create a technical debt.
>
> >...
> > +there is no test to define HAVE_GRANTPT_PTY_ISATTY
>
> Is the definition in xterm_io.h not working?
>
> >...
> > +_POSIX_SOURCE is app-defined not system
>
> This is true for musl, not for glibc.
>
> The handling of _POSIX_SOURCE and _POSIX_VERSION differs between musl
> and glibc due to glibc supporting older POSIX versions, and glibc also
> supporting developers of portable code to select some specific older
> POSIX version.
>
No thats not right.
_POSIX_SOURCE (like all FTMs) is
defined by the application to request a feature/standards profile
it's not libc telling you "this is posix" or anything like that.
_POSIX_VERSION tells
you that

> >...
> > +-#if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__convex__) || defined(__SCO__) || defined(__QNX__)
> > ++#if defined(_POSIX_VERSION) || defined(SVR4) || defined(__convex__) || defined(__SCO__) || defined(__QNX__)
> > +         int pgrp = setsid();        /* variable may not be used... */
> > + #else
> > +         int pgrp = getpid();
> >...
>
> So this was caused by musl not supporting older versions of POSIX,
> where _POSIX_SOURCE was part of the standard.
>

see above.

> The proper fix would be an autoconf test for setsid().
>

Thats a good idea. I have sent a v2 which adds a configure test got setsid()

> cu
> Adrian


More information about the Openembedded-devel mailing list