mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
isc_stdtime_get() now returns void, not isc_result_t.
This commit is contained in:
parent
9416e9751e
commit
58aaab3687
21 changed files with 63 additions and 160 deletions
|
|
@ -816,8 +816,7 @@ main(int argc, char *argv[]) {
|
|||
}
|
||||
}
|
||||
|
||||
result = isc_stdtime_get(&now);
|
||||
check_result(result, "isc_stdtime_get()");
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
if (startstr != NULL) {
|
||||
start = strtotime(startstr, now, now);
|
||||
|
|
|
|||
|
|
@ -503,8 +503,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
|
|||
CTRACE("request");
|
||||
|
||||
client->state = ns_clientstate_working;
|
||||
if (isc_stdtime_get(&client->requesttime) != ISC_R_SUCCESS)
|
||||
client->requesttime = 0;
|
||||
isc_stdtime_get(&client->requesttime);
|
||||
client->now = client->requesttime;
|
||||
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
|
|||
|
|
@ -1580,8 +1580,7 @@ query_resume(isc_task_t *task, isc_event_t *event) {
|
|||
/*
|
||||
* Update client->now, if we can.
|
||||
*/
|
||||
if (isc_stdtime_get(&now) == ISC_R_SUCCESS)
|
||||
client->now = now;
|
||||
isc_stdtime_get(&now);
|
||||
} else {
|
||||
/*
|
||||
* This is a fetch completion event for a cancelled fetch.
|
||||
|
|
|
|||
|
|
@ -1434,7 +1434,7 @@ update_signatures(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *oldver,
|
|||
goto failure;
|
||||
}
|
||||
|
||||
CHECK(isc_stdtime_get(&now));
|
||||
isc_stdtime_get(&now);
|
||||
expire = 100000 + now; /* XXX */
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -377,8 +377,7 @@ main(int argc, char **argv)
|
|||
result = isc_app_start();
|
||||
check_result(result, "isc_app_start()");
|
||||
|
||||
result = isc_stdtime_get(&now);
|
||||
check_result(result, "isc_stdtime_get()");
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
result = isc_mutex_init(&client_lock);
|
||||
check_result(result, "isc_mutex_init(&client_lock)");
|
||||
|
|
|
|||
|
|
@ -1970,12 +1970,7 @@ t_dns_db_expirenode(char **av) {
|
|||
find_expire_time = (isc_stdtime_t) strtol(find_xtime, NULL, 10);
|
||||
exp_result = t_dns_result_fromtext(exp_find_result);
|
||||
|
||||
isc_result = isc_stdtime_get(&now);
|
||||
if (isc_result != ISC_R_SUCCESS) {
|
||||
t_info("isc_stdtime_get failed %s\n",
|
||||
isc_result_totext(isc_result));
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
dns_fixedname_init(&dns_existingname);
|
||||
len = strlen(existing_name);
|
||||
|
|
@ -2516,14 +2511,7 @@ t_dns_db_find_x(char **av) {
|
|||
if (strstr(findopts, "DNS_DBFIND_VALIDATEGLUE"))
|
||||
opts |= DNS_DBFIND_VALIDATEGLUE;
|
||||
|
||||
isc_result = isc_stdtime_get(&now);
|
||||
if (isc_result != ISC_R_SUCCESS) {
|
||||
t_info("isc_stdtime_get failed %s\n",
|
||||
isc_result_totext(isc_result));
|
||||
dns_db_detach(&db);
|
||||
isc_mem_destroy(&mctx);
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
ftime = strtol(findtime, NULL, 10);
|
||||
if (ftime != 0)
|
||||
|
|
|
|||
|
|
@ -816,8 +816,7 @@ main(int argc, char *argv[]) {
|
|||
}
|
||||
}
|
||||
|
||||
result = isc_stdtime_get(&now);
|
||||
check_result(result, "isc_stdtime_get()");
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
if (startstr != NULL) {
|
||||
start = strtotime(startstr, now, now);
|
||||
|
|
|
|||
|
|
@ -221,11 +221,8 @@ dns_a6_foreach(dns_a6context_t *a6ctx, dns_rdataset_t *rdataset,
|
|||
REQUIRE(VALID_A6CONTEXT(a6ctx));
|
||||
REQUIRE(rdataset->type == dns_rdatatype_a6);
|
||||
|
||||
if (now == 0) {
|
||||
result = isc_stdtime_get(&now);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
}
|
||||
if (now == 0)
|
||||
isc_stdtime_get(&now);
|
||||
a6ctx->now = now;
|
||||
|
||||
result = foreach(a6ctx, rdataset, a6ctx->depth, a6ctx->prefixlen);
|
||||
|
|
|
|||
|
|
@ -1829,12 +1829,7 @@ timer_cleanup(isc_task_t *task, isc_event_t *ev)
|
|||
|
||||
LOCK(&adb->lock);
|
||||
|
||||
result = isc_stdtime_get(&now);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
DP(DEF_LEVEL,
|
||||
"isc_stdtime_get() failed! Resetting clean timer.");
|
||||
goto reset;
|
||||
}
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
/*
|
||||
* Call our cleanup routine.
|
||||
|
|
@ -1865,7 +1860,6 @@ timer_cleanup(isc_task_t *task, isc_event_t *ev)
|
|||
/*
|
||||
* Reset the timer.
|
||||
*/
|
||||
reset:
|
||||
result = isc_timer_reset(adb->timer, isc_timertype_once, NULL,
|
||||
&adb->tick_interval, ISC_FALSE);
|
||||
|
||||
|
|
@ -2179,11 +2173,8 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
|
|||
query_pending = 0;
|
||||
want_event = ISC_FALSE;
|
||||
|
||||
if (now == 0) {
|
||||
result = isc_stdtime_get(&now);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
}
|
||||
if (now == 0)
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
/*
|
||||
* XXXMLG Move this comment somewhere else!
|
||||
|
|
@ -2456,11 +2447,8 @@ _dns_adb_insert(dns_adb_t *adb, dns_name_t *host, isc_sockaddr_t *addr,
|
|||
REQUIRE(host != NULL);
|
||||
REQUIRE(addr != NULL);
|
||||
|
||||
if (now == 0) {
|
||||
result = isc_stdtime_get(&now);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
}
|
||||
if (now == 0)
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
expire_time = now + ttl;
|
||||
|
||||
|
|
@ -2713,10 +2701,8 @@ dump_adb(dns_adb_t *adb, FILE *f)
|
|||
char tmp[512];
|
||||
const char *tmpp;
|
||||
isc_stdtime_t now;
|
||||
isc_result_t result;
|
||||
|
||||
result = isc_stdtime_get(&now);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
fprintf(f, "ADB %p DUMP:\n", adb);
|
||||
fprintf(f, "erefcnt %u, irefcnt %u, finds out %u\n",
|
||||
|
|
@ -3171,9 +3157,8 @@ fetch_callback(isc_task_t *task, isc_event_t *ev)
|
|||
/*
|
||||
* We got something potentially useful.
|
||||
*/
|
||||
result = isc_stdtime_get(&now);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
result = import_rdataset(name, &fetch->rdataset, now);
|
||||
isc_stdtime_get(&now);
|
||||
result = import_rdataset(name, &fetch->rdataset, now);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
ev_status = DNS_EVENT_ADBMOREADDRESSES;
|
||||
|
||||
|
|
@ -3259,9 +3244,7 @@ fetch_callback_a6(isc_task_t *task, isc_event_t *ev)
|
|||
return;
|
||||
}
|
||||
|
||||
result = isc_stdtime_get(&now);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto out;
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
/*
|
||||
* If the A6 query didn't succeed, and this is the first query
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: cache.c,v 1.3 1999/12/02 23:53:08 gson Exp $ */
|
||||
/* $Id: cache.c,v 1.4 1999/12/16 23:29:04 explorer Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
#include <limits.h>
|
||||
|
|
@ -482,7 +482,7 @@ incremental_cleaning_action(isc_task_t *task, isc_event_t *event) {
|
|||
cache_cleaner_t *cleaner = event->arg;
|
||||
isc_stdtime_t now;
|
||||
INSIST(event->type == DNS_EVENT_CACHECLEAN);
|
||||
RUNTIME_CHECK(isc_stdtime_get(&now) == ISC_R_SUCCESS);
|
||||
isc_stdtime_get(&now);
|
||||
/*
|
||||
* The return value from do_some_cleaning() is ignored because it
|
||||
* does its own error reporting.
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* $Id: dnssec.c,v 1.13 1999/11/02 22:58:28 bwelling Exp $
|
||||
* $Id: dnssec.c,v 1.14 1999/12/16 23:29:04 explorer Exp $
|
||||
* Principal Author: Brian Wellington
|
||||
*/
|
||||
|
||||
|
|
@ -408,9 +408,7 @@ dns_dnssec_verify(dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
|||
if (ret != ISC_R_SUCCESS)
|
||||
return (ret);
|
||||
|
||||
ret = isc_stdtime_get(&now);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
goto cleanup_struct;
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
/* Is SIG temporally valid? */
|
||||
if (sig.timesigned > now)
|
||||
|
|
@ -633,7 +631,7 @@ dns_dnssec_signmessage(dns_message_t *msg, dst_key_t *key) {
|
|||
sig.labels = 1; /* the root name */
|
||||
sig.originalttl = 0;
|
||||
|
||||
RETERR(isc_stdtime_get(&now));
|
||||
isc_stdtime_get(&now);
|
||||
sig.timesigned = now - DNS_TSIG_FUDGE;
|
||||
sig.timeexpire = now + DNS_TSIG_FUDGE;
|
||||
|
||||
|
|
@ -774,7 +772,7 @@ dns_dnssec_verifymessage(dns_message_t *msg, dst_key_t *key) {
|
|||
RETERR(dns_rdata_tostruct(&rdata, &sig, mctx));
|
||||
signeedsfree = ISC_TRUE;
|
||||
|
||||
RETERR(isc_stdtime_get(&now));
|
||||
isc_stdtime_get(&now);
|
||||
if (sig.timesigned > now) {
|
||||
result = DNS_R_SIGFUTURE;
|
||||
msg->sig0status = dns_tsigerror_badtime;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: master.c,v 1.32 1999/11/30 02:21:59 gson Exp $ */
|
||||
/* $Id: master.c,v 1.33 1999/12/16 23:29:05 explorer Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -170,7 +170,6 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin,
|
|||
char *include_file = NULL;
|
||||
isc_token_t token;
|
||||
dns_result_t result = DNS_R_UNEXPECTED;
|
||||
isc_result_t iresult;
|
||||
rdatalist_head_t glue_list;
|
||||
rdatalist_head_t current_list;
|
||||
dns_rdatalist_t *this;
|
||||
|
|
@ -343,7 +342,7 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin,
|
|||
isc_int64_t dump_time64;
|
||||
isc_stdtime_t dump_time, current_time;
|
||||
GETTOKEN(lex, 0, &token, ISC_FALSE);
|
||||
iresult = isc_stdtime_get(¤t_time);
|
||||
isc_stdtime_get(¤t_time);
|
||||
result = dns_time64_fromtext(token.value.
|
||||
as_pointer, &dump_time64);
|
||||
dump_time = (isc_stdtime_t)dump_time64;
|
||||
|
|
|
|||
|
|
@ -692,8 +692,7 @@ dns_master_dumptostream(isc_mem_t *mctx, dns_db_t *db,
|
|||
dns_fixedname_init(&fixname);
|
||||
name = dns_fixedname_name(&fixname);
|
||||
|
||||
if (isc_stdtime_get(&now) != ISC_R_SUCCESS)
|
||||
return (DNS_R_UNEXPECTED);
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
bufmem = isc_mem_get(mctx, initial_buffer_length);
|
||||
if (bufmem == NULL)
|
||||
|
|
|
|||
|
|
@ -2225,13 +2225,8 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
|
|||
REQUIRE(VALID_RBTDB(search.rbtdb));
|
||||
REQUIRE(version == NULL);
|
||||
|
||||
if (now == 0 && isc_stdtime_get(&now) != ISC_R_SUCCESS) {
|
||||
/*
|
||||
* We don't need to call UNEXPECTED_ERROR() because
|
||||
* isc_stdtime_get() will already have done so.
|
||||
*/
|
||||
return (DNS_R_UNEXPECTED);
|
||||
}
|
||||
if (now == 0)
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
search.rbtversion = NULL;
|
||||
search.serial = 1;
|
||||
|
|
@ -2504,13 +2499,8 @@ cache_findzonecut(dns_db_t *db, dns_name_t *name, unsigned int options,
|
|||
|
||||
REQUIRE(VALID_RBTDB(search.rbtdb));
|
||||
|
||||
if (now == 0 && isc_stdtime_get(&now) != ISC_R_SUCCESS) {
|
||||
/*
|
||||
* We don't need to call UNEXPECTED_ERROR() because
|
||||
* isc_stdtime_get() will already have done so.
|
||||
*/
|
||||
return (DNS_R_UNEXPECTED);
|
||||
}
|
||||
if (now == 0)
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
search.rbtversion = NULL;
|
||||
search.serial = 1;
|
||||
|
|
@ -2675,13 +2665,8 @@ expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now) {
|
|||
|
||||
REQUIRE(VALID_RBTDB(rbtdb));
|
||||
|
||||
if (now == 0 && isc_stdtime_get(&now) != ISC_R_SUCCESS) {
|
||||
/*
|
||||
* We don't need to call UNEXPECTED_ERROR() because
|
||||
* isc_stdtime_get() will already have done so.
|
||||
*/
|
||||
return (DNS_R_UNEXPECTED);
|
||||
}
|
||||
if (now == 0)
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
LOCK(&rbtdb->node_locks[rbtnode->locknum].lock);
|
||||
|
||||
|
|
@ -2876,13 +2861,8 @@ cache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
|
||||
result = ISC_R_SUCCESS;
|
||||
|
||||
if (now == 0 && isc_stdtime_get(&now) != ISC_R_SUCCESS) {
|
||||
/*
|
||||
* We don't need to call UNEXPECTED_ERROR() because
|
||||
* isc_stdtime_get() will already have done so.
|
||||
*/
|
||||
return (DNS_R_UNEXPECTED);
|
||||
}
|
||||
if (now == 0)
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
LOCK(&rbtdb->node_locks[rbtnode->locknum].lock);
|
||||
|
||||
|
|
@ -2969,15 +2949,8 @@ allrdatasets(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
UNLOCK(&rbtdb->lock);
|
||||
}
|
||||
} else {
|
||||
if (now == 0 && isc_stdtime_get(&now) != ISC_R_SUCCESS) {
|
||||
/*
|
||||
* We don't need to call UNEXPECTED_ERROR() because
|
||||
* isc_stdtime_get() will already have done so.
|
||||
*/
|
||||
isc_mem_put(rbtdb->common.mctx, iterator,
|
||||
sizeof *iterator);
|
||||
return (DNS_R_UNEXPECTED);
|
||||
}
|
||||
if (now == 0)
|
||||
isc_stdtime_get(&now);
|
||||
rbtversion = NULL;
|
||||
}
|
||||
|
||||
|
|
@ -3309,8 +3282,8 @@ addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
REQUIRE(VALID_RBTDB(rbtdb));
|
||||
|
||||
if (rbtversion == NULL) {
|
||||
if (now == 0 && isc_stdtime_get(&now) != ISC_R_SUCCESS)
|
||||
return (DNS_R_UNEXPECTED);
|
||||
if (now == 0)
|
||||
isc_stdtime_get(&now);
|
||||
} else
|
||||
now = 0;
|
||||
|
||||
|
|
@ -3615,14 +3588,10 @@ beginload(dns_db_t *db, dns_addrdatasetfunc_t *addp, dns_dbload_t **dbloadp) {
|
|||
return (DNS_R_NOMEMORY);
|
||||
|
||||
loadctx->rbtdb = rbtdb;
|
||||
if ((rbtdb->common.attributes & DNS_DBATTR_CACHE) != 0) {
|
||||
if (isc_stdtime_get(&loadctx->now) != ISC_R_SUCCESS) {
|
||||
result = DNS_R_UNEXPECTED;
|
||||
goto cleanup_loadctx;
|
||||
}
|
||||
} else {
|
||||
if ((rbtdb->common.attributes & DNS_DBATTR_CACHE) != 0)
|
||||
isc_stdtime_get(&loadctx->now);
|
||||
else
|
||||
loadctx->now = 0;
|
||||
}
|
||||
|
||||
LOCK(&rbtdb->lock);
|
||||
|
||||
|
|
|
|||
|
|
@ -1031,9 +1031,7 @@ fctx_getaddresses(fetchctx_t *fctx) {
|
|||
options |= DNS_ADBFIND_INET;
|
||||
if (res->dispatch6 != NULL)
|
||||
options |= DNS_ADBFIND_INET6;
|
||||
result = isc_stdtime_get(&now);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
INSIST(ISC_LIST_EMPTY(fctx->finds));
|
||||
|
||||
|
|
@ -2718,9 +2716,7 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
|
|||
if (result != ISC_R_SUCCESS)
|
||||
goto done;
|
||||
finish = &tnow;
|
||||
result = isc_stdtime_get(&now);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto done;
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
message = fctx->rmessage;
|
||||
message->querytsig = query->tsig;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* $Id: tsig.c,v 1.34 1999/12/06 12:40:31 brister Exp $
|
||||
* $Id: tsig.c,v 1.35 1999/12/16 23:29:06 explorer Exp $
|
||||
* Principal Author: Brian Wellington
|
||||
*/
|
||||
|
||||
|
|
@ -284,9 +284,7 @@ dns_tsig_sign(dns_message_t *msg) {
|
|||
if (ret != ISC_R_SUCCESS)
|
||||
goto cleanup_struct;
|
||||
|
||||
ret = isc_stdtime_get(&now);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
goto cleanup_algorithm;
|
||||
isc_stdtime_get(&now);
|
||||
tsig->timesigned = now;
|
||||
tsig->fudge = DNS_TSIG_FUDGE;
|
||||
|
||||
|
|
@ -620,9 +618,7 @@ dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg) {
|
|||
key = tsigkey->key;
|
||||
|
||||
/* Is the time ok? */
|
||||
ret = isc_stdtime_get(&now);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
goto cleanup_key;
|
||||
isc_stdtime_get(&now);
|
||||
if (abs(now - tsig->timesigned) > tsig->fudge) {
|
||||
msg->tsigstatus = dns_tsigerror_badtime;
|
||||
return (DNS_R_TSIGVERIFYFAILURE);
|
||||
|
|
@ -824,9 +820,7 @@ dns_tsig_verify_tcp(isc_buffer_t *source, dns_message_t *msg) {
|
|||
}
|
||||
|
||||
/* Is the time ok? */
|
||||
ret = isc_stdtime_get(&now);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
goto cleanup_struct;
|
||||
isc_stdtime_get(&now);
|
||||
if (abs(now - tsig->timesigned) > tsig->fudge) {
|
||||
msg->tsigstatus = dns_tsigerror_badtime;
|
||||
return (DNS_R_TSIGVERIFYFAILURE);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: zone.c,v 1.48 1999/12/16 23:11:05 gson Exp $ */
|
||||
/* $Id: zone.c,v 1.49 1999/12/16 23:29:06 explorer Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -2100,8 +2100,7 @@ refresh_callback(isc_task_t *task, isc_event_t *event) {
|
|||
if (zone->curmaster >= zone->masterscnt) {
|
||||
zone->flags &= ~DNS_ZONE_F_REFRESH;
|
||||
|
||||
if (isc_stdtime_get(&now) != ISC_R_SUCCESS)
|
||||
return;
|
||||
isc_stdtime_get(&now);
|
||||
zone_settimer(zone, now);
|
||||
UNLOCK(&zone->lock);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ ISC_LANG_BEGINDECLS
|
|||
*/
|
||||
typedef isc_uint32_t isc_stdtime_t;
|
||||
|
||||
isc_result_t
|
||||
void
|
||||
isc_stdtime_get(isc_stdtime_t *t);
|
||||
/*
|
||||
* Set 't' to the number of seconds since 00:00:00 UTC, January 1, 1970.
|
||||
|
|
@ -41,11 +41,6 @@ isc_stdtime_get(isc_stdtime_t *t);
|
|||
* Requires:
|
||||
*
|
||||
* 't' is a valid pointer.
|
||||
*
|
||||
* Returns:
|
||||
*
|
||||
* Success
|
||||
* Unexpected error
|
||||
*/
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
|
|
|||
|
|
@ -30,8 +30,9 @@
|
|||
#include <isc/error.h>
|
||||
#include <isc/stdtime.h>
|
||||
|
||||
isc_result_t
|
||||
isc_stdtime_get(isc_stdtime_t *t) {
|
||||
void
|
||||
isc_stdtime_get(isc_stdtime_t *t)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
/*
|
||||
|
|
@ -41,12 +42,7 @@ isc_stdtime_get(isc_stdtime_t *t) {
|
|||
|
||||
REQUIRE(t != NULL);
|
||||
|
||||
if (gettimeofday(&tv, NULL) == -1) {
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__, strerror(errno));
|
||||
return (ISC_R_UNEXPECTED);
|
||||
}
|
||||
RUNTIME_CHECK(gettimeofday(&tv, NULL) != -1);
|
||||
|
||||
*t = (unsigned int)tv.tv_sec;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: stdtime.h,v 1.1 1999/09/23 18:34:27 tale Exp $ */
|
||||
/* $Id: stdtime.h,v 1.2 1999/12/16 23:29:07 explorer Exp $ */
|
||||
|
||||
#ifndef ISC_STDTIME_H
|
||||
#define ISC_STDTIME_H 1
|
||||
|
|
@ -35,7 +35,7 @@ ISC_LANG_BEGINDECLS
|
|||
*/
|
||||
typedef isc_uint32_t isc_stdtime_t;
|
||||
|
||||
isc_result_t
|
||||
void
|
||||
isc_stdtime_get(isc_stdtime_t *t);
|
||||
/*
|
||||
* Set 't' to the number of seconds since 00:00:00 UTC, January 1, 1970.
|
||||
|
|
@ -43,10 +43,6 @@ isc_stdtime_get(isc_stdtime_t *t);
|
|||
* Requires:
|
||||
*
|
||||
* 't' is a valid pointer.
|
||||
*
|
||||
* Returns:
|
||||
*
|
||||
* Success
|
||||
*/
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
|
|
|||
|
|
@ -15,22 +15,21 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: stdtime.c,v 1.1 1999/09/23 18:34:27 tale Exp $ */
|
||||
/* $Id: stdtime.c,v 1.2 1999/12/16 23:29:07 explorer Exp $ */
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include <isc/assertions.h>
|
||||
#include <isc/stdtime.h>
|
||||
|
||||
isc_result_t
|
||||
isc_stdtime_get(isc_stdtime_t *t) {
|
||||
void
|
||||
isc_stdtime_get(isc_stdtime_t *t)
|
||||
{
|
||||
/*
|
||||
* Set 't' to the number of seconds past 00:00:00 UTC, January 1, 1970.
|
||||
*/
|
||||
|
||||
REQUIRE(t != NULL);
|
||||
|
||||
time(t);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
(void)time(t);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue