INN commit: trunk/lib (dbz.c)
INN Commit
Russ_Allbery at isc.org
Sat Feb 10 22:27:46 UTC 2007
Date: Saturday, February 10, 2007 @ 14:27:46
Author: eagle
Revision: 7603
Don't use ints; we lose with large files on many systems. Use xpwrite
instead of pwrite to get complete writes. Based on a patch by Chris
Caputo.
Modified:
trunk/lib/dbz.c
-------+
dbz.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Modified: dbz.c
===================================================================
--- dbz.c 2007-02-10 22:19:49 UTC (rev 7602)
+++ dbz.c 2007-02-10 22:27:46 UTC (rev 7603)
@@ -701,7 +701,7 @@
free(tab->core);
if (tab->incore == INCORE_MMAP) {
#if defined(HAVE_MMAP)
- if (munmap(tab->core, (int)conf.tsize * tab->reclen) == -1) {
+ if (munmap(tab->core, conf.tsize * tab->reclen) == -1) {
syswarn("closehashtable: munmap failed");
}
#else
@@ -1246,8 +1246,8 @@
getcore(hash_table *tab)
{
char *it;
- int nread;
- int i;
+ ssize_t nread;
+ size_t i;
struct stat st;
size_t length = conf.tsize * tab->reclen;
@@ -1303,14 +1303,14 @@
static bool
putcore(hash_table *tab)
{
- int size;
+ size_t size;
if (tab->incore == INCORE_MEM) {
if(options.writethrough)
return true;
nonblocking(tab->fd, false);
size = tab->reclen * conf.tsize;
- if (pwrite(tab->fd, tab->core, size, 0) != size) {
+ if (xpwrite(tab->fd, tab->core, size, 0) != size) {
nonblocking(tab->fd, options.nonblock);
return false;
}
@@ -1318,7 +1318,7 @@
}
#ifdef HAVE_MMAP
if(tab->incore == INCORE_MMAP) {
- msync(tab->core, (int)conf.tsize * tab->reclen, MS_ASYNC);
+ msync(tab->core, conf.tsize * tab->reclen, MS_ASYNC);
}
#endif
return true;
More information about the inn-committers
mailing list