VirtualBox

Changeset 63676 in vbox


Ignore:
Timestamp:
Aug 31, 2016 4:17:19 PM (8 years ago)
Author:
vboxsync
Message:

NAT: soread - errno is valid only when syscall indicates failure, so
set saved sockerr to 0 on success (because POLA).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/socket.c

    r63675 r63676  
    322322    nn = recv(so->s, iov[0].iov_base, iov[0].iov_len, (so->so_tcpcb->t_force? MSG_OOB:0));
    323323#endif
    324     sockerr = errno;  /* save it, as it may be clobbered by logging */
     324    if (nn < 0)
     325        sockerr = errno; /* save it, as it may be clobbered by logging */
     326    else
     327        sockerr = 0;
     328
    325329    Log2(("%s: read(1) nn = %d bytes\n", RT_GCC_EXTENSION __PRETTY_FUNCTION__, nn));
    326330    Log2(("%s: so = %R[natsock] so->so_snd = %R[sbuf]\n", RT_GCC_EXTENSION __PRETTY_FUNCTION__, so, sb));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette