diff options
author | Christopher Faylor <me@cgf.cx> | 2002-11-07 03:47:53 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-11-07 03:47:53 +0000 |
commit | 3869357061c19a15c4198ee084336caf0791d943 (patch) | |
tree | 9aa65d1c7e968c1eb8f9774bdc15cb2c193dfdf2 | |
parent | e7c2b4002069dfa618562b39d4644dbc0f7e2736 (diff) | |
download | newlib-github/unlabeled-1.69.4.zip newlib-github/unlabeled-1.69.4.tar.gz newlib-github/unlabeled-1.69.4.tar.bz2 |
* include/cygwin/version.h: Bump API minor number for below export.github/unlabeled-1.69.4unlabeled-1.69.4
* cygwin.din (pututline): New exported function.
* syscalls.cc (login): Use pututiline().
(setutent): Open utmp as read/write.
(endutent): Check if utmp file is open.
(utmpname): call endutent() to close current utmp file.
(getutid): Enable all cases, use strncmp() to compare ut_id fields.
(pututline): New.
* tty.cc (create_tty_master): Set ut_pid to current pid.
* fhandler.h (fhandler_serial::vmin_): Declare as size_t.
* fhandler_serial.cc (fhandler_serial::raw_read): Use correct type for
minchars.
(fhandler_serial::ioctl): Set errno if the ClearCommError fails.
(fhandler_serial::tcsetattr): Use correct value for vmin_.
(fhandler_serial::tcgetattr): Ditto.
* fhandler_socket.cc (fhandler_socket::recvmsg): Call if from == NULL
WSARecvFrom with fromlen = NULL.
-rw-r--r-- | winsup/cygwin/fhandler_socket.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index eadc9b3..f2970ac 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -734,14 +734,16 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot) struct iovec *const iov = msg->msg_iov; const int iovcnt = msg->msg_iovlen; + struct sockaddr *from = (struct sockaddr *) msg->msg_name; + int *fromlen = from ? &msg->msg_namelen : NULL; + int res; if (!winsock2_active) { if (iovcnt == 1) res = recvfrom (iov->iov_base, iov->iov_len, flags, - (struct sockaddr *) msg->msg_name, - &msg->msg_namelen); + from, fromlen); else { if (tot == -1) // i.e. if not pre-calculated by the caller. @@ -766,8 +768,7 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot) else { res = recvfrom (buf, tot, flags, - (struct sockaddr *) msg->msg_name, - &msg->msg_namelen); + from, fromlen); const struct iovec *iovptr = iov; int nbytes = res; @@ -805,16 +806,14 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot) if (is_nonblocking ()) res = WSARecvFrom (get_socket (), wsabuf, iovcnt, &ret, (DWORD *) &flags, - (struct sockaddr *) msg->msg_name, - &msg->msg_namelen, + from, fromlen, NULL, NULL); else { wsock_event wsock_evt; res = WSARecvFrom (get_socket (), wsabuf, iovcnt, &ret, (DWORD *) &flags, - (struct sockaddr *) msg->msg_name, - &msg->msg_namelen, + from, fromlen, wsock_evt.prepare (), NULL); if (res == SOCKET_ERROR && WSAGetLastError () == WSA_IO_PENDING) |