X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Fexim_dbutil.c;h=a05d729c0e4c6c19132bc88170b1b04e37e338b7;hb=7e9f683dbbd65f95ffbe6324af9951893e8d85ac;hp=5e00eaea86f3c4544a3099448677f5bb773b8837;hpb=ff790e47f2de6f4d6d48148e1d5a67da8e93c446;p=exim.git diff --git a/src/src/exim_dbutil.c b/src/src/exim_dbutil.c index 5e00eaea8..a05d729c0 100644 --- a/src/src/exim_dbutil.c +++ b/src/src/exim_dbutil.c @@ -1,10 +1,10 @@ -/* $Cambridge: exim/src/src/exim_dbutil.c,v 1.6 2005/06/22 15:44:38 ph10 Exp $ */ +/* $Cambridge: exim/src/src/exim_dbutil.c,v 1.10 2006/02/07 11:19:00 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2005 */ +/* Copyright (c) University of Cambridge 1995 - 2006 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -316,7 +316,7 @@ if (rc < 0) printf("** Failed to get %s lock for %s: %s", ((flags & O_RDONLY) != 0)? "read" : "write", buffer, (errno == ETIMEDOUT)? "timed out" : strerror(errno)); - close(dbblock->lockfd); + (void)close(dbblock->lockfd); return NULL; } @@ -336,7 +336,7 @@ if (dbblock->dbptr == NULL) "" #endif ); - close(dbblock->lockfd); + (void)close(dbblock->lockfd); return NULL; } @@ -361,7 +361,7 @@ static void dbfn_close(open_db *dbblock) { EXIM_DBCLOSE(dbblock->dbptr); -close(dbblock->lockfd); +(void)close(dbblock->lockfd); } @@ -767,8 +767,8 @@ for(;;) /* If the buffer contains just one digit, or just consists of "d", use the previous name for an update. */ - if ((isdigit((uschar)buffer[0]) && !isdigit((uschar)buffer[1])) || - Ustrcmp(buffer, "d") == 0) + if ((isdigit((uschar)buffer[0]) && (buffer[1] == ' ' || buffer[1] == '\0')) + || Ustrcmp(buffer, "d") == 0) { if (name[0] == 0) { @@ -894,7 +894,8 @@ for(;;) break; case type_ratelimit: - ratelimit = (dbdata_ratelimit *)value; + ratelimit = (dbdata_ratelimit *)record; + length = sizeof(dbdata_ratelimit); switch(fieldno) { case 0: @@ -904,6 +905,7 @@ for(;;) case 1: ratelimit->time_usec = Uatoi(value); + break; case 2: ratelimit->rate = Ustrtod(value, NULL); @@ -1014,7 +1016,7 @@ for(;;) break; case type_ratelimit: - ratelimit = (dbdata_ratelimit *)value; + ratelimit = (dbdata_ratelimit *)record; printf("0 time stamp: %s\n", print_time(ratelimit->time_stamp)); printf("1 fract. time: .%06d\n", ratelimit->time_usec); printf("2 sender rate: % .3f\n", ratelimit->rate);