Bug 1146 - fprintf return code
Summary: fprintf return code
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.3.5
: P2 normal
Target Milestone: ---
Assignee: GOTO Masanori
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-01 18:43 UTC by Karl Heyes
Modified: 2019-04-10 10:08 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Heyes 2005-08-01 18:43:55 UTC
checked of Fedora core 4

A recent report of an app we develope caused me to check the fprintf call. My
understanding is that on an error (like EFBIG from the write syscall) the
fprintf should return a negative value. Instead I'm seeing values greater than 0
returned, which would match the length of the string returned.

It may only be that 1 errno value, I haven't checked all possiblilities but I
thought I should let you know.

karl.
Comment 1 Ralph Corderoy 2005-09-02 11:17:45 UTC
This looks like it may be similar to an Ubuntu bug that has a
test program.  http://bugzilla.ubuntu.com/show_bug.cgi?id=14542
Comment 2 Ralph Corderoy 2005-09-06 18:46:32 UTC
I think Ulrich Drepper may have fixed this in CVS having been told of the
problem by Jim Meyering.

2005-09-04  Ulrich Drepper  <drepper@redhat.com>
        ...
        * stdio-common/Makefile (tests): Add tst-put-error.
        * stdio-common/tst-put-error.c: New file.
        * libio/fileops.c (_IO_new_file_xsputn): If overflow fails and no more
        data would have to be written signal error.
        * libio/oldfileops.c (_IO_old_file_xsputn): Likewise.
Comment 3 Andreas Jaeger 2005-09-16 13:22:05 UTC
Should be fixed by Ulrich's patch.