fix formatting
This commit is contained in:
parent
0371d66a64
commit
6566d27da4
@ -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);
|
||||
|
@ -165,10 +165,11 @@ gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
|
||||
if (tz != NULL)
|
||||
{
|
||||
if (!tzflag) {
|
||||
tzset();
|
||||
tzflag = true;
|
||||
}
|
||||
if (!tzflag)
|
||||
{
|
||||
tzset();
|
||||
tzflag = true;
|
||||
}
|
||||
tz->tz_minuteswest = _timezone / 60;
|
||||
tz->tz_dsttime = _daylight;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user