summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-11-23 12:04:02 +0100
committerMichael Adam <obnox@samba.org>2013-11-23 12:09:59 +0100
commitffa3a56ab8f67a2c137f68fe5611fa6524128a8c (patch)
treeba3fa6db53978977dd6f2ea27d8a363b28cb8351 /src
parent76bd008cf944f2ecda73a6cf61ca27a900b19d01 (diff)
buffer: reduce indentation in read_buffer()
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 49216fd..4c046c6 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -236,29 +236,27 @@ ssize_t read_buffer (int fd, struct buffer_s * buffptr)
"readbuff: add_to_buffer() error.");
bytesin = -1;
}
+ } else if (bytesin == 0) {
+ /* connection was closed by client */
+ bytesin = -1;
} else {
- if (bytesin == 0) {
- /* connection was closed by client */
- bytesin = -1;
- } else {
- switch (errno) {
+ switch (errno) {
#ifdef EWOULDBLOCK
- case EWOULDBLOCK:
+ case EWOULDBLOCK:
#else
# ifdef EAGAIN
- case EAGAIN:
+ case EAGAIN:
# endif
#endif
- case EINTR:
- bytesin = 0;
- break;
- default:
- log_message (LOG_ERR,
- "readbuff: recv() error \"%s\" on file descriptor %d",
- strerror (errno), fd);
- bytesin = -1;
- break;
- }
+ case EINTR:
+ bytesin = 0;
+ break;
+ default:
+ log_message (LOG_ERR,
+ "readbuff: recv() error \"%s\" on file descriptor %d",
+ strerror (errno), fd);
+ bytesin = -1;
+ break;
}
}