Love Hörnquist Åstrand
63565137d3
don't set i = 0, its never read
2011-06-14 21:57:34 -07:00
Love Hornquist Astrand
0879b9831a
remove trailing whitespace
2011-05-21 11:57:31 -07:00
Thomas Klausner
97df66c0a0
Put Nd argument after Nd macro.
...
Signed-off-by: Love Hornquist Astrand <lha@h5l.org >
2011-05-21 11:54:27 -07:00
Thomas Klausner
db8e287e41
Use "Fl Fl" for long options.
...
Signed-off-by: Love Hornquist Astrand <lha@h5l.org >
2011-05-21 11:54:14 -07:00
Love Hornquist Astrand
5774dcfbd8
actually return datum with real content
2011-05-17 21:54:32 -07:00
Love Hornquist Astrand
f78cb2ca4b
Only include myflags if we use HAVE_DB3
2011-05-17 21:48:33 -07:00
Love Hornquist Astrand
01f0a1f509
move tsearch.c to autodetection for libroken.la
2011-05-17 21:47:02 -07:00
Jeffrey Altman
e5bc391f2e
roken: declare IN_LOOPBACKNET if necessary
...
Not all platforms provide a definition of
IN_LOOPBACKNET. Let roken define it if it is otherwise
undeclared.
Change-Id: Ibbac2fc4045671237fae23119746b37afb3b83fb
2011-05-17 12:02:09 -04:00
Jeffrey Altman
e8aea380be
Fix get_windows_size() on Windows
...
The committed implementation of get_windows_size() failed
to compile on the Windows platform.
'int ret' declaration is moved to avoid unused variable
warning.
Change-Id: I0f6ea4524db736d539b10c6bd7836a770a5e7058
2011-05-17 12:02:08 -04:00
Love Hornquist Astrand
b1909b2daa
Fixes from NetBSD via Thomas Klausner and Roland C. Dowdeswell
2011-05-04 21:31:10 -07:00
Love Hornquist Astrand
9a1a5e5da6
Mandoc and spelling fixes from Thomas Klausner
2011-04-29 20:37:33 -07:00
Love Hornquist Astrand
f5f9014c90
Warning fixes from Christos Zoulas
...
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
Love Hornquist Astrand
81a03fafd2
is rk, not rx
2011-04-14 13:08:16 -07:00
Derrick Brashear
988355d9d0
roken: Make tsearch build on windows
...
no sys/cdefs.h on windows
2011-04-10 21:49:48 +01:00
Love Hornquist Astrand
36f9851a4e
remove tsearch manpage
2011-04-09 18:30:58 -07:00
Derrick Brashear
2a32bf67f0
Add tsearch and friends, and a test program
...
tsearch is missing from windows. use the netbsd version as it's
license-compatible.
2011-04-08 15:15:36 +01:00
Simon Wilkinson
a597ccdde6
roken: Rename gettimeofday replacement
...
All replacement roken functions are named rk_blah to avoid symbol
collisions. gettimeofday wasn't being renamed in the header, so fix
that.
This doesn't change the soname of the resulting library, as gettimeofday
isn't currently exported.
2011-04-05 19:44:11 +01:00
Love Hornquist Astrand
3c241aef9e
don't undefined SLIST
2010-12-12 11:45:53 -08:00
Asanka C. Herath
e4d2d78a21
Condition roken's ssize_t definition for compatibility
...
If SSIZE_T_DEFINED macro is defined, assume we already have ssize_t.
2010-12-03 01:12:32 -05:00
Asanka C. Herath
d4f1d0e900
Canonicalize the program name if necessary in setprogname()
2010-11-29 13:32:24 -05:00
Love Hornquist Astrand
987faedb80
add random abstraction
2010-11-29 09:31:07 -08:00
Love Hornquist Astrand
bad0e733c5
less exit with failures
2010-11-29 09:31:07 -08:00
Love Hornquist Astrand
a2b45360c2
add random_init
2010-11-29 09:31:07 -08:00
Love Hornquist Astrand
a2345c5159
remove debug printing
2010-11-27 18:59:17 -08:00
Love Hornquist Astrand
beedb73f80
print roken.h so we ca see what's happening
2010-11-27 18:21:16 -08:00
Asanka C. Herath
e412b8c511
Don't override build environment with header files in roken
2010-11-25 23:51:42 -05:00
Asanka C. Herath
d4379e27de
Windows: Interlocked ops work on LONGs
...
Therefore change the type of the TLS slot id to LONG.
2010-11-24 15:33:35 -05:00
Asanka C. Herath
bd6e3ff7c9
Provide a stdbool.h in roken
2010-11-24 15:33:34 -05:00
Asanka C. Herath
0ae44152b7
Windows: Set error mode before calling LoadLibrary()
...
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.
2010-11-24 15:33:20 -05:00
Asanka C. Herath
538c7ce29c
More compatibility macros
...
Undefine SLIST_ENTRY to avoid conflict with WinNT.h
Define AI_NUMERICSERV for platforms that don't define it.
2010-11-24 15:33:15 -05:00
Asanka C. Herath
d11917211b
Windows: Older Windows SDKs need <winsock2.h>
...
Older SDKs need <winsock2.h> to be included before <ws2tcpip.h>
2010-11-24 15:33:06 -05:00
Asanka C. Herath
1e365190d0
Windows: Manage thread local storage manually in dlfcn_w32
2010-11-24 15:32:51 -05:00
Asanka C. Herath
e4a2e9cfe0
Windows: Build and export localtime_r
2010-11-24 15:32:49 -05:00
Asanka C. Herath
a87b4e23d6
Windows: Implement gettimeofday() using native APIs
...
We now use GetSystemTimeAsFileTime() for gettimeofday(). This gives
us a better resolution than one second.
2010-11-24 15:32:26 -05:00
Asanka C. Herath
8f7a1311e1
Windows: Construct search string from directory name
...
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.
2010-11-24 15:32:07 -05:00
Simon Wilkinson
9fc90e01b5
roken: Remove multiple prototype for hstrerror
...
hsterror had two prototypes, one with the Windows magic, and one
without. Remove the one without so Windows can build again.
2010-11-24 10:32:55 +00:00
Jeffrey Altman
f317b91b1b
roken: Prototype getopt
...
Add a prototype for getopt to the roken.h header, and fix the function
definition in getopt.c to be ANSI, rather than K&Rs style.
2010-11-24 09:43:04 +00:00
Asanka C. Herath
0cc7b890e2
Windows: Build getopt.c in roken
2010-11-23 02:25:34 -05:00
Asanka C. Herath
e266044cc4
Declarations for getopt externs
2010-11-23 02:25:24 -05:00
Asanka C. Herath
904d779d06
Windows: Support building roken as a DLL
2010-11-23 02:25:17 -05:00
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