X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Flookups%2Fcdb.c;h=c0ac2cbe45e360c902b4745386b8c7e305decb99;hb=7f83b348ccf4cd815e9758ab9ca1012e66324e9d;hp=3a95f8ed0200948575cf67cc4db45b090baf9921;hpb=1e1ddfac79fbcd052f199500a6493c7f79cb8462;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/lookups/cdb.c b/src/src/lookups/cdb.c index 3a95f8ed0..c0ac2cbe4 100644 --- a/src/src/lookups/cdb.c +++ b/src/src/lookups/cdb.c @@ -157,19 +157,14 @@ void * mapbuf; if ((fileno = Uopen(filename, O_RDONLY, 0)) < 0) { - int save_errno = errno; - *errmsg = string_open_failed(errno, "%s for cdb lookup", filename); - errno = save_errno; + *errmsg = string_open_failed("%s for cdb lookup", filename); return NULL; } if (fstat(fileno, &statbuf) != 0) { - int save_errno = errno; - *errmsg = string_open_failed(errno, - "fstat(%s) failed - cannot do cdb lookup", + *errmsg = string_open_failed("fstat(%s) failed - cannot do cdb lookup", filename); - errno = save_errno; return NULL; } @@ -178,11 +173,7 @@ CDB_HASH_TABLE bytes long */ if (statbuf.st_size < CDB_HASH_TABLE) { - int save_errno = errno; - *errmsg = string_open_failed(errno, - "%s too short for cdb lookup", - filename); - errno = save_errno; + *errmsg = string_open_failed("%s too short for cdb lookup", filename); return NULL; } @@ -231,8 +222,7 @@ if (cdb_bread(fileno, cdbp->cdb_offsets, CDB_HASH_TABLE) == -1) /* read of hash table failed, oh dear, oh..... time to give up I think.... call the close routine (deallocs the memory), and return NULL */ - *errmsg = string_open_failed(errno, - "cannot read header from %s for cdb lookup", + *errmsg = string_open_failed("cannot read header from %s for cdb lookup", filename); cdb_close(cdbp); return NULL; @@ -281,9 +271,6 @@ hash_offset, hash_offlen, hash_slotnm; -/* Keep picky compilers happy */ -do_cache = do_cache; - key_hash = cdb_hash(keystring, key_len); hash_offset_entry = CDB_HASH_ENTRY * (key_hash & CDB_HASH_MASK);