Unless SEM_FAILCRITICALERRORS is set, Windows may pop-up a dialog box
if the specified module cannot be loaded. This is not appropriate for
unattended or batch processes.
The implementation of opendir() in lib/roken/dirent.c takes as input a
directory name. For the contents of the specified directory to be
enumerated correctly, this directory name must be converted to a
wildcard.
Before we can include ws2tcpip.h, we must have already included
winsock2.h. The latest SDK does this by including winsock2 within
the ws2tcpip header, but the older SDKs do not, and fail to build.
roken/rename.c is for platforms where the native rename()
implementation does not replace the target if it already exists. This
implementation isn't atomic, but should be close enough for most
purposes.
For correct behavior, rk_rename() should be used instead of rename().
rk_rename() is #defined to be rename() on platforms where this fix is
not necessary.
It won't cause harm since strcpy_s() deals with zero length buffers,
but it invokes the invalid parameter handler, which can disrupt
execution on debug builds.
Sockets and file descriptors are not interchangeable on Windows. The
test for checking whether a given value is a socket or an FD was
broken for the case where WinSock was not initialized to begin with.
libroken implementation of inet_ntop() was not compressing strings of
zeros. While it is optional, not doing so was intefering with address
conversion tests in lib/krb5.
Adds --with-berkeley-db-include=dir option to configure to use berkeley
db headers in dir. Default is to let configure check. Also adds
support for checking for and using db5/db.h
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
String argument to WSAStringToAddress() is not const, while argument
to inet_pton() is. Create a non-const string for the purpose of
calling WSAStringToAddress()
Appease the compiler by resolving some of the reported warnings,
including:
- Control paths that don't return.
- Potentially uninitialized variables.
- Unused local variables.
- Unreachable code.
- Type safety.
- Synchronize declarations with definitions for functions.
When using WinSock, a socket is not a file descriptor and does not
interoperate with read()/write(). File descriptors do not work with
send()/recv(). However, for net_read() and net_write(), we don't know
whether we are dealing with a socket or a file descriptor. So try
one, and if it fails, try the other.
This is an ugly hack until we clean up the users of this API so it
doesn't use sockets and fds interchangably.