This patch causes the pthread and lwp implementations of rxi_Sendmsg()
to use -errno or WSAGetLastError() as the return value if it is
positive. This is required in order to communicate more meaningful
error conditions to rxi_SendPacket[List], which should "down" a host
immediately when it observes ENETUNREACH.
Jeff Altman <jaltman@openafs.org> supplied the logic for the
AFS_NT40_ENV case; I was not able to test this (I do not own a
Windows license) and took him on his word.
Reviewed-on: http://gerrit.openafs.org/58
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Adam Megacz <megacz@gmail.com>
Tested-by: Adam Megacz <megacz@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
{
(osi_Msg "rx failed to send packet: ");
perror("rx_sendmsg");
+#ifndef AFS_NT40_ENV
+ if (errno > 0)
+ return -errno;
+#elif
+ if (WSAGetLastError() > 0)
+ return -WSAGetLastError();
+#endif
return -1;
}
while ((err = select(socket + 1, 0, sfds, 0, 0)) != 1) {
#endif
dpf(("rxi_sendmsg failed, error %d\n", errno));
fflush(stdout);
+#ifndef AFS_NT40_ENV
+ if (errno > 0)
+ return -errno;
+#elif
+ if (WSAGetLastError() > 0)
+ return -WSAGetLastError();
+#endif
return -1;
}
return 0;