This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/10932] libio use isatty() but don't take care of -ENOTTY
- From: "yann at droneaud dot fr" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 9 Nov 2009 21:56:03 -0000
- Subject: [Bug libc/10932] libio use isatty() but don't take care of -ENOTTY
- References: <20091109164151.10932.yann@droneaud.fr>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From yann at droneaud dot fr 2009-11-09 21:56 -------
Created an attachment (id=4375)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=4375&action=view)
Improved test case (use ferror() and feof())
Here is another version of the test case which use ferror() and feof() to
distinguish EOF roots (rationale:
<http://www.opengroup.org/onlinepubs/9699919799/functions/fgetc.html> )
Without fix:
$ ./stdio-errno /dev/null
fscanf() returned EOF
feof() returned true
>>> fscanf() failed: 25 Inappropriate ioctl for device
fgetc() returned EOF
feof() returned true
>>> fgetc() failed: 25 Inappropriate ioctl for device
$ ./stdio-errno /dev/zero
fscanf() failed to parse anything
fgetc() returned 0 (0x00000000)
>>> fgetc() failed: 25 Inappropriate ioctl for device
With fix:
$ ../scm/glibc-build/testrun.sh ./stdio-errno /dev/null
fscanf() returned EOF
feof() returned true
fgetc() returned EOF
feof() returned true
$ ../scm/glibc-build/testrun.sh ./stdio-errno /dev/zero
fscanf() failed to parse anything
fgetc() returned 0 (0x00000000)
--
What |Removed |Added
----------------------------------------------------------------------------
Attachment #4371 is|0 |1
obsolete| |
http://sourceware.org/bugzilla/show_bug.cgi?id=10932
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.