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.y...@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

Reply via email to