buffer: reduce indentation in read_buffer()

Signed-off-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Michael Adam 2013-11-23 12:04:02 +01:00
parent 76bd008cf9
commit ffa3a56ab8

View File

@ -236,29 +236,27 @@ ssize_t read_buffer (int fd, struct buffer_s * buffptr)
"readbuff: add_to_buffer() error."); "readbuff: add_to_buffer() error.");
bytesin = -1; bytesin = -1;
} }
} else if (bytesin == 0) {
/* connection was closed by client */
bytesin = -1;
} else { } else {
if (bytesin == 0) { switch (errno) {
/* connection was closed by client */
bytesin = -1;
} else {
switch (errno) {
#ifdef EWOULDBLOCK #ifdef EWOULDBLOCK
case EWOULDBLOCK: case EWOULDBLOCK:
#else #else
# ifdef EAGAIN # ifdef EAGAIN
case EAGAIN: case EAGAIN:
# endif # endif
#endif #endif
case EINTR: case EINTR:
bytesin = 0; bytesin = 0;
break; break;
default: default:
log_message (LOG_ERR, log_message (LOG_ERR,
"readbuff: recv() error \"%s\" on file descriptor %d", "readbuff: recv() error \"%s\" on file descriptor %d",
strerror (errno), fd); strerror (errno), fd);
bytesin = -1; bytesin = -1;
break; break;
}
} }
} }