-/* $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.11 2007/01/08 10:50:18 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 2005 */
+/* Copyright (c) University of Cambridge 1995 - 2007 */
/* See the file NOTICE for conditions of use and distribution. */
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;
}
""
#endif
);
- close(dbblock->lockfd);
+ (void)close(dbblock->lockfd);
return NULL;
}
dbfn_close(open_db *dbblock)
{
EXIM_DBCLOSE(dbblock->dbptr);
-close(dbblock->lockfd);
+(void)close(dbblock->lockfd);
}
/* 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)
{
break;
case type_ratelimit:
- ratelimit = (dbdata_ratelimit *)value;
+ ratelimit = (dbdata_ratelimit *)record;
+ length = sizeof(dbdata_ratelimit);
switch(fieldno)
{
case 0:
case 1:
ratelimit->time_usec = Uatoi(value);
+ break;
case 2:
ratelimit->rate = Ustrtod(value, NULL);
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);