- /*
- * TODODRW: change this to create a new function time_t cdb_get_timestamp( struct cdbdata *)
- * this will release this file from the serv_network.h
- * Maybe it could be a macro that extracts and casts the reult
- */
- memcpy(&ut, cdbut->ptr,
- ((cdbut->len > sizeof(struct UseTable)) ?
- sizeof(struct UseTable) : cdbut->len));
- cdb_free(cdbut);
+ syslog(LOG_DEBUG, "Purge use table: phase 1");
+ cdb_rewind(CDB_USETABLE);
+ while(cdbut = cdb_next_item(CDB_USETABLE), cdbut != NULL)
+ {
+ if (cdbut->len > sizeof(struct UseTable))
+ memcpy(&ut, cdbut->ptr, sizeof(struct UseTable));
+ else
+ {
+ memset(&ut, 0, sizeof(struct UseTable));
+ memcpy(&ut, cdbut->ptr, cdbut->len);
+ }
+ cdb_free(cdbut);