Re: Why does close_stdout close stdout and stderr?

2019-05-07 Thread NeilBrown
On Tue, May 07 2019, Bruno Haible wrote: > Assaf Gordon wrote: >> 4. >> "fflush" instead of "fclose" seems to work OK, but I do not know >> if there are other side effects: >> >>$ ./aa stdout fflush > /dev/full && echo ok || echo error >>aa: fflush failed: No space left on device >>er

Coverity false positives triggered by gnulib's implementation of base64

2019-05-07 Thread Kamil Dudka
Coverity Analysis 2019.03 incorrectly marks the input argument of base64_encode(), and conseuqnetly base64_encode_alloc(), as tainted_data_sink because it sees byte-level operations on the input. It triggered the following false positives in the cryptsetup project: Error: TAINTED_SCALAR: lib/luk

Re: Why does close_stdout close stdout and stderr?

2019-05-07 Thread Bruno Haible
Assaf Gordon wrote: > 4. > "fflush" instead of "fclose" seems to work OK, but I do not know > if there are other side effects: > >$ ./aa stdout fflush > /dev/full && echo ok || echo error >aa: fflush failed: No space left on device >error Except that it does not work OK on NFS, as exp

Re: Why does close_stdout close stdout and stderr?

2019-05-07 Thread Assaf Gordon
I should've added: On 2019-05-07 3:44 a.m., Assaf Gordon wrote: I'm attaching a sample test program to illustrate some points. The program writes to stdout/stderr then optionally calls fclose/fflush/fsync. Note the following: The attached program also calls "ferror" on the stream, but it d

Re: Why does close_stdout close stdout and stderr?

2019-05-07 Thread Assaf Gordon
Hello all, joining a bit late to this discussion, but I'd like to add another POV on why fclose is important and useful: On 2019-04-29 1:45 p.m., Florian Weimer wrote: I get that error checking is important. But why not just use ferror and fflush? Closing the streams is excessive and tends to i