Commit e3bc529d authored by Wayne Davison's avatar Wayne Davison

Handle EINTR when reading the pre-xfer exec message.

parent 820f7a7b
...@@ -374,7 +374,14 @@ static char *finish_pre_exec(pid_t pid, int write_fd, int read_fd, char *request ...@@ -374,7 +374,14 @@ static char *finish_pre_exec(pid_t pid, int write_fd, int read_fd, char *request
/* Read the stdout from the pre-xfer exec program. This it is only /* Read the stdout from the pre-xfer exec program. This it is only
* displayed to the user if the script also returns an error status. */ * displayed to the user if the script also returns an error status. */
for (bp = buf; msglen > 0 && (j = read(read_fd, bp, msglen)) > 0; msglen -= j) { for (bp = buf; msglen > 0; msglen -= j) {
if ((j = read(read_fd, bp, msglen)) <= 0) {
if (j == 0)
break;
if (errno == EINTR)
continue;
break; /* Just ignore the read error for now... */
}
bp += j; bp += j;
if (j > 1 && bp[-1] == '\n' && bp[-2] == '\r') { if (j > 1 && bp[-1] == '\n' && bp[-2] == '\r') {
bp--; bp--;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment