reqs: Fix CID 1130969 (part 3) - unchecked return value from library.
Check the return value of socket_blocking (fcntl) at the end of relay_connection() for client socket. Signed-off-by: Michael Adam <obnox@samba.org>
This commit is contained in:
parent
e07c363df2
commit
3710accf72
@ -1210,7 +1210,14 @@ static void relay_connection (struct conn_s *connptr)
|
|||||||
* Here the server has closed the connection... write the
|
* Here the server has closed the connection... write the
|
||||||
* remainder to the client and then exit.
|
* remainder to the client and then exit.
|
||||||
*/
|
*/
|
||||||
socket_blocking (connptr->client_fd);
|
ret = socket_blocking (connptr->client_fd);
|
||||||
|
if (ret != 0) {
|
||||||
|
log_message(LOG_ERR,
|
||||||
|
"Failed to set client socket to blocking: %s",
|
||||||
|
strerror(errno));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
while (buffer_size (connptr->sbuffer) > 0) {
|
while (buffer_size (connptr->sbuffer) > 0) {
|
||||||
if (write_buffer (connptr->client_fd, connptr->sbuffer) < 0)
|
if (write_buffer (connptr->client_fd, connptr->sbuffer) < 0)
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user