Commit Graph

40 Commits

Author SHA1 Message Date
christos
aae80e6be7 remove mpool_getf 2016-09-24 21:31:25 +00:00
christos
86147b1c32 Merge the recursive tree traversal changes from the mit kerberos tree. This
Also make the tracefile customizable. Unfortunately we can't merge any of
the hash changes because they have a different on-disk format. That does not
matter really because we've fixed most of the problems...
2016-09-24 20:11:12 +00:00
christos
3504287a90 fix bug in previous change (sz should be the size of the newly allocated
buffer).
2013-12-25 19:42:23 +00:00
christos
e73d0381b5 It's been many years since realloc(NULL, size) == malloc(size). Also don't
destroy pointers on allocation errors so someone can free them later.
2013-12-14 18:04:56 +00:00
christos
b605a13ba6 - centralize opening of regular and temp files to avoid code duplication
- don't cast malloc
- use malloc sizeof(*var) instead of sizeof(type)
2013-12-01 00:22:48 +00:00
christos
a26b732aad put back some compat code for systems that don't have O_CLOEXEC. 2011-06-26 22:27:14 +00:00
christos
5589fc5ec0 - Fix bug copying only 1 byte instead of the whole page number. Broke nvi
joining lines that needed R_BIGDATA.
- Fix from FreeBSD for nrec IAFTER.
XXX: Should be pulled up to 5.x
2011-06-26 22:18:16 +00:00
christos
9ad6d70c15 use O_CLOEXEC 2011-06-26 22:16:46 +00:00
mrg
493d341048 various build fixes for gcc 4.5. from chuq. XXX i'm not sure all of
these work properly wtf pointer aliasing, but there are no casts at
least...

the lib/libpuffs/puffs_priv.h is definately a real bug fix.

from chuq.
2011-06-20 09:11:16 +00:00
joerg
d3595ddff7 Consistently include "nbtool_config.h" when cross-compiling. 2008-09-11 12:58:00 +00:00
joerg
52c4a82ef2 In preparation for providing a db fallback in libnbcompat, remove
sccsid and conditionals around __RCSID. lint understands __RCSID enough
to ignore it, undefining LIBC_SCCS is superseded by MKSTRIPIDENT.
No functional changes.
2008-09-10 17:52:35 +00:00
joerg
40b37a3bf2 Convert db from UCB types to POSIX types. Prefer uint8_t for u_char as
it is mostly about the wire format.

Patched libc.so is bit-identical.

OK matt@
2008-08-26 21:18:38 +00:00
christos
cb9daf8f10 cleanup:
- remove __P
	- remove unneeded casts
	- add _DIAGASSERT
	- add more diagnostics for integer overflow
	- fix size_t/int confusion
	- make debugging and statistics code compile
2007-02-03 23:46:09 +00:00
lukem
63246b1ef4 Ensure dbp is initialized to NULL before trying to use it in an error codepath.
Detected with gcc -Wuninitialized.
(The bug was introduced in rev 1.13.  Hi Mycroft! :)
2005-06-01 05:39:17 +00:00
mycroft
b7e6351cc4 hash already uses FD_CLOEXEC -- pay attention to the return value and make it
a hard failure.

Also make btree and recno uses FD_CLOEXEC.
2005-01-19 00:23:44 +00:00
jmc
b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
agc
eb7c1594f1 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-08-07 16:42:00 +00:00
thorpej
e5538ceafb Fix signed/unsigned comparison warnings. 2002-11-11 20:05:53 +00:00
thorpej
e23f3d9104 Fix -Wshadow warnings (gcc 3.1). 2001-12-30 19:26:28 +00:00
lukem
50f5afd52e fix WARNS=2 (-Wshadow) warnings 2001-11-04 13:57:29 +00:00
aymeric
b39251c6b2 indx_t can be a 16 bit type, and is thus not suited to hold a difference
between two pointers in the general case. Replace it by ptrdiff_t.

-> recno databases can now handle records of more than 64KB
-> nvi can now handle files with lines bigger than 64KB

Problem and fix suggested by FreeBSD PR#9350
2001-09-30 21:12:00 +00:00
msaitoh
f9b799b651 check LIBC_SCCS 2000-09-13 22:32:25 +00:00
christos
61238e7179 delint 1998-12-09 12:42:46 +00:00
thorpej
e79648d085 Add some braces to make egcs happy. 1998-08-18 23:50:08 +00:00
kleink
23a9b2c5c9 Change the file mode argument to dbopen() and the db backends from int to
mode_t.
1998-05-07 19:24:20 +00:00
mycroft
4462053ab3 Fill in missing (default) mmap(2) flags. 1998-02-20 09:27:18 +00:00
jtc
43fa6fe319 If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore.  The library will use those
names internally.  Weak aliases are used to provide the original names
to the API.

This is only the first part of this change.  It is most of the functions
which are implemented in C for all NetBSD ports.  Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
1997-07-21 14:06:24 +00:00
christos
00ae392d92 Fix RCSID's
Fix gcc warnings.
1997-07-13 18:51:48 +00:00
cgd
738330da77 merge DB 1.85 changes 1996-05-03 21:38:43 +00:00
cgd
2c84ad3a41 add unintrusive Ids 1995-02-27 13:22:58 +00:00
cgd
a6d14e368c clean up import 1994-08-18 00:38:04 +00:00
cgd
a2f41483b7 repeat after me: realloc, THEN assign pointer... 1994-02-24 09:03:39 +00:00
cgd
bc3e04db85 DTRT when recno db's are extended beyond current end of db 1994-02-21 08:39:53 +00:00
pk
53fa5af0d5 Remove potential spoilsport. 1994-02-17 21:13:26 +00:00
cgd
65aeeefb0a version 1.71 of new db code 1993-09-17 01:06:18 +00:00
cgd
45e27c8018 upgrade new DB code to version 1.7 1993-09-09 02:41:04 +00:00
jtc
9c20f740a3 Declare rcsid strings so they are stored in text segment. 1993-08-26 00:43:03 +00:00
mycroft
e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
mycroft
cda4f8f6ee Add RCS identifiers. 1993-08-01 05:37:30 +00:00
cgd
9f0aa214be update db code to v1.6 from vangogh, and put it in "db" rather than "DB" 1993-06-14 23:52:39 +00:00