* Re: [newlib-cygwin] Cygwin: ctty: Add comments for the special values: -1 and -2.
[not found] <20230110131557.3B148385843E@sourceware.org>
@ 2023-01-10 14:29 ` Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2023-01-10 14:29 UTC (permalink / raw)
To: Takashi Yano; +Cc: cygwin-patches
On Jan 10 13:15, Takashi Yano via Cygwin-cvs wrote:
> https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3b7df69aaa5752f78537eafa5838f65a1ddfc938
>
> commit 3b7df69aaa5752f78537eafa5838f65a1ddfc938
> Author: Takashi Yano <takashi.yano@nifty.ne.jp>
> Date: Tue Jan 10 22:04:40 2023 +0900
>
> Cygwin: ctty: Add comments for the special values: -1 and -2.
>
> _pinfo::ctty has two special values other than the device id of
> the allocated ctty:
> -1: CTTY is not initialized yet. Can be associated with the TTY
> which is associated with the session leader.
> -2: CTTY has been released by setsid(). Can be associate only with
> new TTY which is not associated with any other session as CTTY,
> but cannot be associate with the TTYs already associated with
> other sessions.
> This patch adds the comments in some source files.
Oh, ok. I was more thinking along the lines of using symbolic values,
kind of like this:
#define CTTY_UNINITIALIZED -1
#define CTTY_RELEASED -2
#define CTTY_IS_FREE(_c) ((_c) < 0)
I'm not sure the names make sense, but you see what I mean. The
comments could precede the definitions in the header file then.
Corinna
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-10 14:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230110131557.3B148385843E@sourceware.org>
2023-01-10 14:29 ` [newlib-cygwin] Cygwin: ctty: Add comments for the special values: -1 and -2 Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).