libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit be4fc7b341f97ca3d25888dd54313c704917fbb8
parent 819353c26d0c995b456bdbbcbd8c815999e22c1a
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 30 Jun 2026 18:54:13 +0200

handle EINTR properly by retrying

Diffstat:
Msrc/main/extractor_ipc_gnu.c | 13++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/main/extractor_ipc_gnu.c b/src/main/extractor_ipc_gnu.c @@ -448,6 +448,8 @@ EXTRACTOR_IPC_channel_send_ (struct EXTRACTOR_Channel *channel, ret = write (channel->cpipe_in, &cdata[off], size - off); if (ret <= 0) { + if ((-1 == ret) && (EINTR == errno)) + continue; if (-1 == ret) LOG_STRERROR ("write"); return -1; @@ -564,9 +566,14 @@ EXTRACTOR_IPC_channel_recv_ (struct EXTRACTOR_Channel **channels, } channel->mdata = ndata; } - if ( (-1 == (iret = read (channel->cpipe_out, - &channel->mdata[channel->size], - channel->mdata_size - channel->size)) ) || + do + { + iret = read (channel->cpipe_out, + &channel->mdata[channel->size], + channel->mdata_size - channel->size); + } + while ((-1 == iret) && (EINTR == errno)); + if ( (-1 == iret) || (0 == iret) || (-1 == (ret = EXTRACTOR_IPC_process_reply_ (channel->plugin, channel->mdata,