Arnaud Quette <[email protected]> writes: > 2011/6/29 Frédéric Bohé <[email protected]> >> Another bug. errno has to be filled with the result of GetLastError() to >> be really useful. >> > > wasn't it suppose to be already the case? > along with the equivalent winsock WSAGetLastError() where appropriate? > otherwise, this should indeed fix tons of issues, as it did years ago on > Linux...
Not sure if it was supposed to be the case, but the libusb module wasn't doing it at the moment. I've finally been able to work up a build environment, and setting errno to the libusb function result (well, its negative) does appear to resolve the issue. And Frédéric's other fix to the WaitForMultipleObjects in dstate.c does take care of the otherwise tight polling loop. Note that in this case you don't want to set errno directly to GetLastError() since libusb is already doing a translation between the Win32 value into an more standard errno E* value for the purpose of the function result. The raw GetLastError() wouldn't be sensible for the higher level code expecting errno values - would it ever be? Not sure about any WSAGetLastError but there's no socket related actions in this code path, so that could be for other use cases. -- David _______________________________________________ Nut-upsuser mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

