summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-08-01 21:02:31 +0200
committerChristian Grothoff <christian@grothoff.org>2019-08-01 21:02:31 +0200
commitd21cf2c1c225c888a3fd6161a6a04357714cc628 (patch)
tree80eb506b2db84bf41a77aa51d09d42c1842f79c3
parent4b62caead6edb2d4b75ef1c99e653d4b30ac9007 (diff)
reduce variable scope
-rw-r--r--src/microhttpd/mhd_send.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 5fed8767..36d8afa7 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -350,7 +350,6 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection,
{
#if defined(HAVE_SENDMSG) || defined(HAVE_WRITEV)
MHD_socket s = connection->socket_fd;
- int iovcnt;
ssize_t ret;
struct iovec vector[2];
@@ -374,8 +373,12 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection,
ret = sendmsg (s, &msg, MAYBE_MSG_NOSIGNAL);
}
#elif HAVE_WRITEV
- iovcnt = sizeof (vector) / sizeof (struct iovec);
- ret = writev (s, vector, iovcnt);
+ {
+ int iovcnt;
+
+ iovcnt = sizeof (vector) / sizeof (struct iovec);
+ ret = writev (s, vector, iovcnt);
+ }
#endif
/* Only if we succeeded sending the full buffer, we need to make sure that