delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/03/01/08:38:03

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3E60B397.394804C1@phekda.freeserve.co.uk>
Date: Sat, 01 Mar 2003 13:20:23 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT elta DOT co DOT il>
CC: djgpp-workers AT delorie DOT com
Subject: Re: Use _get_dev_info & constants in isatty;add test [PATCH]
References: <E18oPAP-0001Aw-00 AT phekda DOT freeserve DOT co DOT uk> <5567-Sat01Mar2003141929+0200-eliz AT elta DOT co DOT il>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Eli Zaretskii wrote:
> 
> > Date: Thu, 27 Feb 2003 14:40:28 +0000
> > From: "Richard Dawe" <rich AT phekda DOT freeserve DOT co DOT uk>
> >
> > I noticed the other day that isatty uses values rather than using
> > the constants from <libc/getdinfo.h>. So I fixed that. I also made
> > it use a _get_dev_info call, rather than duplicating that code.
> > Using _get_dev_info means that it will detect bad file descriptors
> > and return errno == EBADF and -1 (as required by POSIX).
> > I also added a test program. See the patch below.
> >
> > OK to commit?
> 
> Yes, thanks.

Committed.

> Please add something to wc204.txi about isatty testing invalid
> handles and returning EBADF, unlike in previous versions.

Yes, of course. Thanks for catching that! I added this text to
src/docs/kb/wc204.txi.

"The function @code{isatty} now checks whether the file descriptor
passed to it is a valid.  If not, it will fail and set @code{errno} to
@code{EBADF}."

Bye, Rich =]

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019