Re: [PATCH 1/3] gcc: Add missing parentheses around ternary operator

Robert Elz <[email protected]>
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
    Date:        Sun, 5 Sep 2021 05:18:44 +0000
    From:        David Holland <[email protected]>
    Message-ID:  <[email protected]>

  | I mean, the other reason it's harmless is that O_NOCTTY doesn't
  | actually do anything.

Oh, that I didn't know ... and I admit to not bothering to check.
I just assumed that if a process with no controlling tty opened a
tty device with that flag set, that terminal wouldn't become its
controlling tty.

If we don't implement that, is there any reason?

But now I see you're right, the only mentions of O_NOCTTY in the kernel
sources are its definition in sys/fcntl.h and a bunch of code in the linux
emulation converting the linux O_NOCTTY bit value into ours, and then
attempting to make its inverse work, for linux emulated binaries.

Oh, is it that we effectively default to O_NOCTTY on all opens,
and require TIOCSCTTY to claim a controlling terminal?

That would all then make sense.   And that the O_NOCTTY flag wasn't being
passwd through that cpp "deal with calendar" (and "at" perhaps) truly
irrelevant, and totally explains why the error affected nothing at all.

kre

ps; I am aware it is not a POSIX defined flag.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.