nc-vsock: shutdown output socket on input EOF

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This commit is contained in:
Ian Campbell 2016-03-31 16:34:14 +01:00
parent a9784a5fe0
commit f9825fbafd

View File

@ -219,7 +219,12 @@ static int xfer_data(int in_fd, int out_fd)
return -1;
}
if (nbytes == 0) {
return 0;
int rc;
if (out_fd == STDOUT_FILENO) return 0;
rc = shutdown(out_fd, SHUT_WR);
if (rc == 0) return 0;
perror("shutdown");
return -1;
}
remaining = nbytes;