Commit Graph

130 Commits

Author SHA1 Message Date
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
christos
340e17eb3b Don't attempt to delete a NULL key. Can happen if we were the only key
in a 64K page. Thanks to Juergen Hannken-Illjes for the test.
2005-04-27 23:11:29 +00:00
christos
c4e3c4d493 Don't refuse to create a hash database on 0 length files. Treat
them as new files the same way that the btree code does.  Note that
we do the fstat() after the open() instead of re-using the previous
result of the stat() to avoid races (we open with O_EXLOCK when we care).
2005-03-29 23:37:15 +00:00
christos
bab13a9d96 Revert previous commit at 1.17. a maximum BSIZE of 65536 ends up stored
as a 0 in the page, but it is supported and it does work.
2005-03-06 03:42:14 +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
uwe
e8d7ac57c1 Add missing .Ed reported by new mdoc. 2004-08-31 17:11:33 +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
wiz
3a6d7bd8c0 Revert part of previous.
[Never argue with a language lawyer, or at least expect to lose ;)]
2004-05-06 19:16:32 +00:00
wiz
7383a5157d Make that NULL, and mark up an extension like a path. 2004-05-01 07:59:09 +00:00
kleink
88d9244df3 Add ndbm(3) documentation, fixing PR lib/25357. 2004-04-30 21:13:23 +00:00
kleink
ceeaed078c XPG4.2: when it is attempted to open a database write-only, silently
"upgrade" to use read/write access on the database file.
2004-04-29 18:37:20 +00:00
kleink
b4e89dd2ab Purge a leftover comment from rev. 1.6. 2004-04-29 16:33:20 +00:00
kleink
dbfbef898d XPG4.2: Change member `dsize' of struct datum from int to size_t.
Version dbm_{delete,fetch,firstkey,nextkey,store}() accordingly.
Fixes PRs standards/21402 from Ben Harris and standards/25343 from
Murray Armfield.
2004-04-28 00:10:52 +00:00
kleink
537be69d5c Remove internal names for dbm_*(3); these are not required at this time. 2004-04-27 20:03:45 +00:00
martin
9f96807631 When storing data size as 32bit int in an overflow page, copy the
length to a temporary u_int32_t variable and memmove from there to the
final destination - instead of copying the first four 0 bytes from a
64bit variable directly on big endian 64 bit platforms.

This makes sparc64 pass regress/lib/libc/db.
2003-12-30 21:20:16 +00:00
lukem
171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +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
wiz
aeeb4fe3d0 Grammar, spelling, markup fixes from jmc@openbsd. 2003-06-06 13:42:49 +00:00
christos
5f8d1cd0cc PR/5996: ITOH Yasufumi: lib/libc/db/hash/* writes memory garbage to db file
Fixed by changing malloc's to calloc's where needed.
2003-04-20 20:41:14 +00:00
wiz
365962d31f Convert to mdoc. 2003-04-17 19:48:37 +00:00
wiz
335e44b3ef Convert to mdoc. 2003-04-17 19:35:03 +00:00
wiz
93ebe1c2f3 Punctuation nit. 2003-04-17 19:32:17 +00:00
wiz
7e06307f35 Convert to mdoc. 2003-04-17 19:18:01 +00:00
wiz
0a1b8c0e9c Increase width in a list. 2003-04-17 19:17:48 +00:00
wiz
6fa350b93d Convert to mdoc. 2003-04-17 18:48:28 +00:00
wiz
f77fff8c0b Convert to mdoc. 2003-04-17 18:14:21 +00:00
simonb
d7b879c6ec Grrr. So much for my ability to use grep(1) effectively. Pointed out
by Stephen Degler in private mail.
2003-01-20 07:12:12 +00:00
simonb
276fd1665c The Double-Semi-Colon Police. 2003-01-20 05:29:53 +00:00
wiz
1388941754 free's -> frees, from PR 19652. 2003-01-04 00:40:20 +00:00
christos
14c54c3327 Only allow BSIZE to 1^16 - 1:
- fix off by one error
    - limit the default from the filesystem
2002-12-11 21:20:15 +00:00
thorpej
e5538ceafb Fix signed/unsigned comparison warnings. 2002-11-11 20:05:53 +00:00
thorpej
20b98814a9 Fix signed/unsigned comparison warnings. 2002-11-11 01:12:04 +00:00
itojun
35eb51aa09 use int32_t, instead of int, for on-disk data.
(so that we are safe in the future)
2002-05-30 14:55:47 +00:00
groo
b8dcd239d9 Do not respect TMPDIR when s[ug]id.
from xs@kittenz.org
2002-04-16 19:00:45 +00:00
ross
814f296b77 Generate <>& symbolically. 2002-02-07 07:00:09 +00:00
thorpej
0f3aee340f Don't pull in <sys/param.h> if we don't have to. 2002-01-22 20:41:21 +00:00
tv
c08a2cb7c2 Add hooks for reachover builds from src/tools/compat. 2002-01-21 21:33:42 +00:00
aymeric
51411b7d2b fix printf(3) warnings when defined(DEBUG) 2002-01-12 11:27:16 +00:00
aymeric
9e09072f0e use %p instead of %x when displaying a pointer 2002-01-12 11:26:13 +00:00
aymeric
238cdd6720 add missing prototype when defined(DEBUG) 2002-01-12 11:24:48 +00:00
thorpej
e23f3d9104 Fix -Wshadow warnings (gcc 3.1). 2001-12-30 19:26:28 +00:00
thorpej
585dfd612c Rename the local variable "index" to "idx" to avoid shadowing a global
declaration.
2001-12-30 19:20:40 +00:00
thorpej
42a6d41394 __bt_search(): Rename the local variable "index" to "idx" to avoid
shadowing a global declaration.
2001-12-30 19:18:23 +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
wiz
260d59cdbe Boring whitespace fixes. 2001-09-16 02:57:26 +00:00
wiz
40ac848024 Fix various misspellings of compatible/compatibility. 2001-06-11 01:50:48 +00:00
cgd
579369d368 build new hsearch() code 2001-02-14 05:44:29 +00:00
cgd
603bfd4ff7 nuke old, unredeemably broken DB-based version of hsearch() et al. 2001-02-14 05:41:46 +00:00
cgd
66678fd1bb move db/man/hcreate.3 to stdlib/hcreate.3 2001-02-14 05:41:01 +00:00