Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-05-12 05:50:38 +0400
committerChristopher Faylor <me@cgf.cx>2002-05-12 05:50:38 +0400
commit6566d27da452d1f4a3397967c63aff7f6257fc9a (patch)
tree599ed32808df5f53b636f58e2f5ffaacc4ccf629 /winsup/cygwin/net.cc
parent0371d66a64f83c0bd34128ad4e4a5d9e0b74e884 (diff)
fix formatting
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r--winsup/cygwin/net.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 357ddd502..c91f0af50 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -2483,21 +2483,23 @@ cygwin_recvmsg(int s, struct msghdr *msg, int flags)
for(i = 0; i < msg->msg_iovlen; ++i)
tot += iov[i].iov_len;
buf = (char *) malloc(tot);
- if (tot != 0 && buf == NULL) {
+ if (tot != 0 && buf == NULL)
+ {
errno = ENOMEM;
return -1;
- }
+ }
nb = ret = cygwin_recvfrom (s, buf, tot, flags,
(struct sockaddr *) msg->msg_name, (int *) &msg->msg_namelen);
p = buf;
- while (nb > 0) {
+ while (nb > 0)
+ {
ssize_t cnt = min(nb, iov->iov_len);
memcpy (iov->iov_base, p, cnt);
p += cnt;
nb -= cnt;
++iov;
- }
+ }
free(buf);
return ret;
}
@@ -2515,15 +2517,17 @@ cygwin_sendmsg(int s, const struct msghdr *msg, int flags)
for(i = 0; i < msg->msg_iovlen; ++i)
tot += iov[i].iov_len;
buf = (char *) malloc(tot);
- if (tot != 0 && buf == NULL) {
+ if (tot != 0 && buf == NULL)
+ {
errno = ENOMEM;
return -1;
- }
+ }
p = buf;
- for (i = 0; i < msg->msg_iovlen; ++i) {
+ for (i = 0; i < msg->msg_iovlen; ++i)
+ {
memcpy (p, iov[i].iov_base, iov[i].iov_len);
p += iov[i].iov_len;
- }
+ }
ret = cygwin_sendto (s, buf, tot, flags,
(struct sockaddr *) msg->msg_name, msg->msg_namelen);
free (buf);