Commit Graph

204 Commits

Author SHA1 Message Date
andvar cbf5c65aff s/occured/occurred/ in comments, log messages and man pages. 2021-12-10 20:36:02 +00:00
kamil ca9a018f12 Avoid undefined behavior in *BIT macros
hash_page.c:792:2, left shift of 1 by 31 places cannot be represented in type 'int'
hash_page.c:855:2, left shift of 1 by 31 places cannot be represented in type 'int'
hash_page.c:779:3, left shift of 1 by 31 places cannot be represented in type 'int'
2020-02-21 22:04:06 +00:00
uwe fdee483c8f __dberr: tweak signature to make gcc8 -Wbad-function-cast happy about
casts in __dbpanic.  Admittedly this is a bit too "cute".
2019-10-05 18:07:58 +00:00
uwe da97884ede __dbpanic: use the official DB typedef name in the casts. They were
copied from the declaration point where it's not yet available.
2019-10-05 18:01:52 +00:00
abhinav e1cf3640ab Fix typo: s/then/the 2019-05-26 06:18:13 +00:00
msaitoh 659e7a3c69 s/ are are / are /
s/ a a / a /
2019-03-08 08:35:58 +00:00
kamil c5b83981a9 Add bunch of missing includes of namespace.h in libc
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change eliminates usage of the global changes of the following symbols:
 - strlcat -> _strlcat
 - sysconf -> __sysconf
 - closedir -> _closedir
 - fparseln -> _fparseln
 - kill -> _kill
 - mkstemp -> _mkstemp
 - reallocarr -> _reallocarr
 - strcasecmp -> _strcasecmp
 - strncasecmp -> _strncasecmp
 - strptime -> _strptime
 - strtok_r -> _strtok_r
 - sysctl -> _sysctl
 - dlopen -> __dlopen
 - dlclose -> __dlclose
 - dlsym -> __dlsym

Sponsored by <The NetBSD Foundation>
2018-01-04 20:57:28 +00:00
joerg 04b0597d11 Fix syntax for currently not compiled in code. From Henning Petersen in
PR lib/51538.
2016-10-09 11:48:24 +00:00
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 d42d73761d When writing out pages in the "other endian" format, make a copy instead of
trashing the in-memory one.
2016-09-24 20:08:29 +00:00
christos d2f713bbd1 don't shortcut closing if the metadata is dirty (from the krb5 tree) 2016-08-31 06:23:51 +00:00
christos 14fcefd52e Introduce a HASH_BSIZE macro to return the blocksize; in the 64K case this
returns 0xffff to avoid overflow. This is used where sizes are stored.
2015-11-18 18:22:42 +00:00
christos 60aa2a0eb6 Account for the -1 hack to fit 0x10000 in a short in hash_page.c 2015-11-18 13:00:46 +00:00
christos 057be2c9f2 If MAX_BSIZE == hashp->BSIZE (65536) then it does not fit in a short, and
we end up storing 0... This means that every entry needs a page. We store
MAX_BSIZE - 1 here, but it would be better to always store (avail - 1) here
so that we don't waste a byte and be consistent.
2015-11-18 00:23:39 +00:00
christos 8b926f831a PR/50441: Manuel Bouyer: hash seq enumeration skips keys on big data.
XXX: pullup-7
2015-11-17 20:19:55 +00:00
christos 25bda9e7c1 Fix hash iteration that deletes the current element under the cursor by
adjusting the position of the iterator appropriately.
XXX: pullup 7
2015-06-22 21:16:02 +00:00
christos 1be34afaf8 Delay moving to the next key until the next iteration. This avoids returning
invalid data to the user if the user deletes the current key, but it also
fails to iterate over some keys as will be shown by a unit test. From FreeBSD.
2015-06-22 18:50:06 +00:00
christos 7310b6ff91 Fix the build for ancient (rhel5) systems that don't have O_CLOEXEC
XXX: pullup-7
2015-05-19 13:20:52 +00:00
christos 0f10d12f2f whitelist O_CLOEXEC flag, should fix lastlogin issue. 2014-12-22 17:01:42 +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 4008ee50a3 knf, reduce pointer gymnastics 2013-12-14 18:04:00 +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 c64e72248f switch from circleq to tailq, from FreeBSD 2013-11-22 16:25:51 +00:00
ryoon 27e03817f7 Fix typos from FreeMiNT's db-1.86 patch. 2013-09-04 13:03:22 +00:00
njoly b6d38f1490 Remove some more unneeded Pp macros. 2012-10-13 15:28:33 +00:00
christos c5e820cae4 PR/45989: Martin Husemann: lint invocation does include -w only on i386
- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
  would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
  builds)

approved by core@
2012-03-13 21:13:30 +00:00
joerg 82c56d333f libc passes the relaxed array boundary check in clang now. 2011-08-09 13:03:36 +00:00
christos ab0103dee5 fix type punned warnings in debugging code. 2011-07-17 20:47:39 +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 dcc9c82156 - use sizeof(var) instead of sizeof(type)
- remove useless cast
2011-06-26 22:20:31 +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 a216da57a6 Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
2011-05-26 12:56:24 +00:00
christos 4957358ed5 Correct check for snprintf() overflow via Maksymilian Arciemowicz from FreeBSD.
(the bt one was ok, but set errno and make it the same for consistency).
[to be pulled up]
2011-04-17 23:12:38 +00:00
jruoho 9f95187844 .Fn, offset indent, complete reference. 2010-12-16 12:08:16 +00:00
jruoho fe6e1d361b Fix the references and -offset indent. 2010-12-16 11:57:20 +00:00
jruoho c1a91d0bee Use .Fn. 2010-12-16 11:49:35 +00:00
jruoho 61d5c5bd31 Note the POSIX compliance (already since SUSv2, '97). 2010-05-05 06:55:57 +00:00
joerg 1c3412fa2f Use .In for header files instead of .Ar Pa and variations. 2010-03-22 19:30:53 +00:00
christos 3c2585b945 correct cast to size_t. 2009-04-23 22:09:23 +00:00
agc 9c3b1325df Cast the arg to an unsigned value to let this compile 2009-04-23 03:49:39 +00:00
njoly 41f89f9e08 Include string.h for memset prototype. 2009-04-22 21:52:59 +00:00
christos 0f03f83ae4 Avoid information leaks by zeroing memory, from FreeBSD (we had done some
already)
2009-04-22 18:44:06 +00:00
joerg 59ba3c43a4 -width needs an argument, so provide one. 2009-04-11 20:39:15 +00:00
lukem c7201a0f39 fix -Wsign-compare issues 2009-02-12 06:35:54 +00:00
lukem eb0de3bfe5 fix sign-compare issues 2009-02-12 06:33:13 +00:00
lukem 79becf98cb sign-compare fixes 2009-01-29 02:02:36 +00:00