[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate
From: |
Samuel Thibault |
Subject: |
Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate |
Date: |
Sun, 18 Jun 2023 23:55:36 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Hello,
Sergey Bugaev, le sam. 10 juin 2023 00:13:22 +0300, a ecrit:
> On Fri, Jun 9, 2023 at 9:37 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
> > You could change the documentation so that it now says that flags that
> > imply O_IGNORE_CTTY are also meaningful. That should be fine.
>
> Perhaps... but there's another reason I don't particularly like the
> idea of doing it on that level.
>
> _hurd_port2fd () and _hurd_intern_fd () is something that you call
> once you already have an io port. O_CREAT and O_DIRECTORY and the rest
> are the flags that impact how you look it up. _hurd_port2fd would have
> to second-guess "this io port is said to have been opened with O_CREAT
> | O_EXCL, so it can't be a ctty". It'd be better to have the caller
> (open) -- that "can see" both looking the port up and interning it --
> implement this bit of logic. Not that this matters for anything,
> because it would still behave the same way no matter which level we
> implement it at; but it seems more appropriate to me to implement it
> at that level.
>
> Samuel, what do you think?
It looks better to me to add a shared helper that adds O_IGNORE_CTTY
whenever the flags contain something that implies it. Callers of
_hurd_intern_fd / _hurd_port2fd can then easily use it (or even just
always pass O_IGNORE_CTTY, when creating a socket for instance).
Samuel
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate, (continued)
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate, Sergey Bugaev, 2023/06/06
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate, Paul Eggert, 2023/06/09
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate, Sergey Bugaev, 2023/06/09
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate, Paul Eggert, 2023/06/09
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate, Sergey Bugaev, 2023/06/10
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate, Paul Eggert, 2023/06/11
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate, Sergey Bugaev, 2023/06/13
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate, Paul Eggert, 2023/06/14
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate, Sergey Bugaev, 2023/06/16
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate, Paul Eggert, 2023/06/17
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate,
Samuel Thibault <=
- Re: [PATCH v3 2/2] Use O_IGNORE_CTTY where appropriate, Sergey Bugaev, 2023/06/19
[PATCH v3 1/2] include/fcntl.h: Define O_IGNORE_CTTY, Sergey Bugaev, 2023/06/04