Skip to content

Commit

Permalink
[#264] Handle return value of 0 from read() i.e. EOF on pipe fd
Browse files Browse the repository at this point in the history
Not doing so could cause the source server to loop indefinitely in case the filter program
terminates prematurely.
  • Loading branch information
nars1 committed May 30, 2018
1 parent 7e7fc16 commit 035ec59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sr_port/repl_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ STATICFNDEF int repl_filter_recv_line(char *line, int *line_len, int max_line_le
do
{
r_len = read(repl_filter_srv_fd[READ_END], srv_read_end, buff_remaining);
if (0 < r_len)
if (0 <= r_len)
break;
save_errno = errno;
if ((ENOMEM != save_errno) && (EINTR != save_errno))
Expand Down

0 comments on commit 035ec59

Please sign in to comment.