Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Mar 2004 11:50:48 -0800
From:      "Jordan K. Hubbard" <jkh@queasyweasel.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: Another conformance question...  This time fputs(). 
Message-ID:  <E7470FE8-6C82-11D8-9000-000393BB9222@queasyweasel.com>
In-Reply-To: <20040302213412.X1223@gamplex.bde.org>
References:  <1060DC2A-6C31-11D8-9000-000393BB9222@queasyweasel.com> <20040302213412.X1223@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail-4--981882491
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

Thanks to everyone (not just bde) for reviewing the fix.  Linux was 
right, I was wrong, EBADF it is!

On Mar 2, 2004, at 4:03 AM, Bruce Evans wrote:

> Should be EBADF, as in Linux.
>
>>                  return (EOF);
>> +       }
>
> Otherwise, I agree with this change except for its style bugs 
> (unsorting
> of the #includes and tab lossage).

Change committed with #includes sorted and proper use of tabs (change 
is consistent with the rest of the file's style).

It's also not clear to me why ENODEV is being returned, though I'm not 
as inclined to blame isatty() since it appears to do the right thing:

#include <stdio.h>
#include <fcntl.h>
#include <errno.h>

main() {
         int fd, ret;

         fd = open("/dev/null", O_RDONLY);
         ret = isatty(fd);
         printf("ret = %d, errno = %d\n", ret, errno);
         close(fd);
}

Prints:	ret = 0, errno = 25

All isatty() does is call tcgetattr(), it doesn't do an 
ioctl(...TIOCGETA...).

--
Jordan K. Hubbard
Engineering Manager, BSD technology group
Apple Computer

--Apple-Mail-4--981882491--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E7470FE8-6C82-11D8-9000-000393BB9222>