Home GnuPG

estream: Avoid calling write(fd,NULL,n).
75172adc3b10Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

estream: Avoid calling write(fd,NULL,n).

* src/estream.c (es_func_fd_write): Take care of a flush requests.
(es_func_w32_write): Ditto.
(es_func_fp_write): Ditto.

The write handlers may be called with (BUFFER,SIZE) of (NULL,0) to
propagate flush events to user supplied functions (es_fopencookie).
However we need to take care to also do this with the internal
handler. Might be a reason for system faults due to write or fwrite
with a NULL buffer; on Linux this seems to be harmless.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Oct 18 2015, 3:26 PM
Parents
rEc09997bc50f3: estream: Keep track of EPIPE.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rE75172adc3b10: estream: Avoid calling write(fd,NULL,n). (authored by Werner Koch <wk@gnupg.org>).Oct 18 2015, 3:26 PM