Re: [PATCH s6] s6-setsid: Only open /dev/tty if it's actually needed

From: Olivier Brunel <jjk_at_jjacky.com>
Date: Sat, 28 Mar 2026 14:47:26 +0100

Hey there,

Quick random question I guess.

On Sat, 28 Mar 2026 12:10:26 +0000
"Laurent Bercot" <ska-skaware_at_skarnet.org> wrote:

> >- else if (wgolb & (GOLB_PGRP | GOLB_FG))
> >+ else if ((wgolb & GOLB_PGRP) && (wgolb & GOLB_FG))
>
> Right, it needs to be an AND, not an OR.
> I fixed it with a simpler expression. ;)

Sorry to ask but, isn't the goal to evaluate true iif *both* flags are
set?

If so, how is that meant to work:

else if (wgolb & GOLB_PGRP & GOLB_FG)

shouldn't it be more the original proposal, or maybe this:

else if ((wgolb & (GOLB_PGRP | GOLB_FG) == (GOLB_PGRP | GOLB_FG)))

I don't get how wgolb & GOLB_PGRP & GOLB_FG can do the intended here?
In fact I don't see how this can ever be true, since GOLB_PGRP &
GOLB_FG is always zero, no?

I'm sure I'm wrong, but what am I missing?

Cheers,
-j
Received on Sat Mar 28 2026 - 14:47:26 CET

This archive was generated by hypermail 2.4.0 : Sat Mar 28 2026 - 14:47:43 CET