Commit Graph

1879 Commits

Author SHA1 Message Date
Asanka C. Herath
1f2dc24b5d Annotate exported variables in getopt.c 2010-11-23 02:24:43 -05:00
Asanka C. Herath
0ee4597aed Always include <config.h> in roken implementation
Remove unnecessary ifdefs and add <config.h> to dlfcn_w32.c.  This is
required for correct export declarations when building roken as a DLL.
2010-11-23 02:24:38 -05:00
Simon Wilkinson
bbd724dad0 roken: getopt should include roken.h
In order to correctly rename the function, getopt.c needs to include
roken.h
2010-11-22 23:33:46 +00:00
Jeffrey Altman
bd78baf668 Windows: Include winsock2.h before ws2tcpip.h
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.
2010-11-22 23:09:07 +00:00
Andrew Bartlett
0225db7152 Don't redefine socket() if socket_wrapper is already in use
In Samba, we may have already included socket_wrapper.h at this point

Andrew Bartlett

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-10-02 20:46:16 -07:00
Love Hornquist Astrand
736a08059a spelling 2010-09-14 10:44:33 -07:00
Love Hornquist Astrand
64a2e57029 add arguments to rk_rename to move it into the macro/function namespace 2010-09-14 10:18:08 -07:00
Asanka Herath
4b36b36e0b Add roken/rename.c to fix non-standard rename()
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.
2010-09-14 08:03:34 -04:00
Asanka Herath
7479c855a0 Windows: Don't attempt to copy a string to a zero length buffer
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.
2010-09-14 08:03:33 -04:00
Asanka Herath
d4fc674024 strlcat() isn't supposed to access *dst past dst_sz
Try not to do that on platforms where we can avoid it.
2010-09-14 08:03:32 -04:00
Asanka Herath
7e3bd7f9aa Windows: Fix use of file descriptors as sockets
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.
2010-09-14 08:03:31 -04:00
Asanka Herath
738e2ea55b Compress zeros when converting IPv6 addresses
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.
2010-09-14 08:03:30 -04:00
Eray Aslan
a1c14b2319 Add --with-berkeley-db-include option
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>
2010-09-05 18:41:30 -07:00
Asanka Herath
5dcc605f6b Fix calling conventions for Windows 2010-08-20 13:14:10 -04:00
Asanka Herath
2a2a662eca roken/parse_time-test.c: Don't pass in incorrect buffer size 2010-08-20 13:09:51 -04:00
Asanka Herath
aee2a6443d roken/test-mini_inetd.c: Use of rk_SOCK_INIT() etc. 2010-08-20 13:09:51 -04:00
Asanka Herath
745d9bcae7 Windows: Pull required declarations into roken.h.in 2010-08-20 13:09:50 -04:00
Asanka Herath
31b2dc9c48 roken/mini_inetd.c: Don't check against FD_SETSIZE unless necessary 2010-08-20 13:09:50 -04:00
Asanka Herath
481fe5bcf6 Windows: lib/roken tests now depend on DNSAPI 2010-08-20 13:09:48 -04:00
Asanka Herath
0d09c879f3 Reduce compiler warnings on Windows 2010-08-20 13:04:06 -04:00
Asanka Herath
f456b70013 Relocate roken WinSock declarations 2010-08-20 13:03:41 -04:00
Asanka Herath
04a7eaa170 Call ioctlsocket() indirectly
We were calling ioctlsocket() through a macro.  However, due to type
safety issues, we have to call it indirectly through rk_SOCK_IOCTL().
2010-08-20 13:03:40 -04:00
Asanka Herath
6b0baa2a8d Fix call to WSAStringToAddress()
String argument to WSAStringToAddress() is not const, while argument
to inet_pton() is.  Create a non-const string for the purpose of
calling WSAStringToAddress()
2010-08-20 13:03:40 -04:00
Asanka Herath
5f87ea3bbf Let dlfcn.h return a function pointer on Windows 2010-08-20 13:03:38 -04:00
Asanka Herath
24cbddd4b9 Resolve warnings on Windows
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.
2010-08-20 13:03:38 -04:00
Asanka Herath
e9160dbcfa Support parallelized builds on Windows 2010-08-20 13:03:32 -04:00
Love Hornquist Astrand
977badd14b fix printf fmt arg warning 2010-08-08 12:29:35 -07:00
Love Hornquist Astrand
dc1baf6ab4 only support DS record conversion if DNS_TYPE_DS is defined 2010-06-01 10:54:47 -07:00
Love Hornquist Astrand
10ad3df8f5 use size_t for lengths 2010-06-01 10:46:57 -07:00
Magnus Holmberg
086885744c Fix argument order of strlcpy
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-06-01 10:25:01 -07:00
Love Hornquist Astrand
9773655027 catch error from as.*printf 2010-05-30 12:41:06 -07:00
Asanka Herath
3e2b840565 Try both fd and socket ops for net_read() and net_write()
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.
2010-05-26 10:38:44 -04:00
Asanka Herath
884f5ac627 Use WinDNS on Windows for DNS 2010-05-26 10:38:41 -04:00
Love Hornquist Astrand
eec74bd2fe Wrap SOCK_CLOEXEC in ifdef, from Harald Barth 2010-04-30 15:15:58 +02:00
Love Hornquist Astrand
32d148b2f8 Check for dd_fd in DIR not struct dirent
Pointed out by Ragnnar Sundblad in private mail
2010-03-21 09:08:46 -07:00
Love Hornquist Astrand
b0a79dcd40 Improve the dns retry logic
Bug reported by Richard Silverman on heimdal-bugs
2010-03-19 14:19:43 -07:00
Love Hornquist Astrand
33d80cbcfc include roken.h 2010-03-12 09:04:39 -08:00
Love Hornquist Astrand
cf1b11f8a0 export more 2010-03-11 23:35:26 -08:00
Love Hornquist Astrand
6da28e73eb move same ifdef magic from roken-common.h.in to here, use strerror() 2010-03-11 23:35:00 -08:00
Love Hornquist Astrand
7d9335ce69 in the STRERROR_R_PROTO_COMPATIBLE case, only provide a rk_strerror_r function if there is a broken prototype
From harald barth.
2010-03-11 18:40:47 -08:00
Love Hornquist Astrand
a46bc97443 Windows code never calls dirfd, avoid warning 2010-02-27 19:23:08 -08:00
Love Hornquist Astrand
94a8d9c5e5 autoconf test for dirfd and dd_fd 2010-02-25 22:18:32 -08:00
Love Hornquist Astrand
24eeb74c4a make getnameinfo quiet by default 2010-02-20 14:01:53 -08:00
Love Hornquist Astrand
7c86764dea make getifaddrs quiet by default 2010-02-20 13:59:39 -08:00
Love Hornquist Astrand
560fc640bb Lowercase linux, from Harald Barth 2010-01-26 22:14:59 -08:00
Love Hornquist Astrand
908ece3604 Adapt for Linux with SOCK_CLOEXEC, patch from Harald Barth 2010-01-26 10:46:51 -08:00
Love Hornquist Astrand
4376b6c8b1 spelling 2010-01-25 23:50:37 -08:00
Love Hornquist Astrand
2fbdb6a514 rewrite socket to rk_socket of there is SOCK_CLOEXEC and there is linux, prompted by Harald Barth 2010-01-25 23:01:18 -08:00
Love Hornquist Astrand
1b3a8d3032 just close socket 2010-01-08 14:19:21 +01:00
Love Hornquist Astrand
f6e0d19cc0 make rk_SOCK_EXIT a statment to avoid warnings 2010-01-08 13:08:24 +01:00