2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 06:55:30 +00:00

use RUNTIME_CHECK instead of INSIST where appropriate

This commit is contained in:
Bob Halley
1999-01-06 20:02:52 +00:00
parent da46905010
commit 2328307a8f
3 changed files with 19 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 1998 Internet Software Consortium. * Copyright (C) 1998, 1999 Internet Software Consortium.
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@@ -499,7 +499,7 @@ run(void *uap) {
LOCK(&manager->lock); LOCK(&manager->lock);
while (!manager->done) { while (!manager->done) {
INSIST(isc_time_get(&now) == ISC_R_SUCCESS); RUNTIME_CHECK(isc_time_get(&now) == ISC_R_SUCCESS);
XTRACETIME("running", now); XTRACETIME("running", now);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 1998 Internet Software Consortium. * Copyright (C) 1998, 1999 Internet Software Consortium.
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@@ -41,7 +41,7 @@
#endif #endif
#define ISC_TASK_SEND(a, b) do { \ #define ISC_TASK_SEND(a, b) do { \
INSIST(isc_task_send(a, b) == ISC_R_SUCCESS); \ RUNTIME_CHECK(isc_task_send(a, b) == ISC_R_SUCCESS); \
} while (0); } while (0);
#define SOFT_ERROR(e) ((e) == EAGAIN || (e) == EWOULDBLOCK || (e) == EINTR) #define SOFT_ERROR(e) ((e) == EAGAIN || (e) == EWOULDBLOCK || (e) == EINTR)
@@ -1475,8 +1475,8 @@ isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp)
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
INSIST(make_nonblock(manager->pipe_fds[0]) == ISC_R_SUCCESS); RUNTIME_CHECK(make_nonblock(manager->pipe_fds[0]) == ISC_R_SUCCESS);
INSIST(make_nonblock(manager->pipe_fds[1]) == ISC_R_SUCCESS); RUNTIME_CHECK(make_nonblock(manager->pipe_fds[1]) == ISC_R_SUCCESS);
/* /*
* Set up initial state for the select loop * Set up initial state for the select loop

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 1998 Internet Software Consortium. * Copyright (C) 1998, 1999 Internet Software Consortium.
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@@ -18,6 +18,8 @@
#ifndef ISC_UTIL_H #ifndef ISC_UTIL_H
#define ISC_UTIL_H 1 #define ISC_UTIL_H 1
#include <isc/error.h>
/*** /***
*** General Macros. *** General Macros.
***/ ***/
@@ -26,32 +28,32 @@
* We use macros instead of calling the routines directly because * We use macros instead of calling the routines directly because
* the capital letters make the locking stand out. * the capital letters make the locking stand out.
* *
* We INSIST that they succeed since there's no way for us to continue * We RUNTIME_CHECK for success since in general there's no way
* if they fail. * for us to continue if they fail.
*/ */
#define LOCK(lp) \ #define LOCK(lp) \
INSIST(isc_mutex_lock((lp)) == ISC_R_SUCCESS) RUNTIME_CHECK(isc_mutex_lock((lp)) == ISC_R_SUCCESS)
#define UNLOCK(lp) \ #define UNLOCK(lp) \
INSIST(isc_mutex_unlock((lp)) == ISC_R_SUCCESS) RUNTIME_CHECK(isc_mutex_unlock((lp)) == ISC_R_SUCCESS)
#define BROADCAST(cvp) \ #define BROADCAST(cvp) \
INSIST(isc_condition_broadcast((cvp)) == ISC_R_SUCCESS) RUNTIME_CHECK(isc_condition_broadcast((cvp)) == ISC_R_SUCCESS)
#define SIGNAL(cvp) \ #define SIGNAL(cvp) \
INSIST(isc_condition_signal((cvp)) == ISC_R_SUCCESS) RUNTIME_CHECK(isc_condition_signal((cvp)) == ISC_R_SUCCESS)
#define WAIT(cvp, lp) \ #define WAIT(cvp, lp) \
INSIST(isc_condition_wait((cvp), (lp)) == ISC_R_SUCCESS) RUNTIME_CHECK(isc_condition_wait((cvp), (lp)) == ISC_R_SUCCESS)
/* /*
* isc_condition_waituntil can return ISC_R_TIMEDOUT, so we * isc_condition_waituntil can return ISC_R_TIMEDOUT, so we
* don't INSIST the result is ISC_R_SUCCESS. * don't RUNTIME_CHECK the result.
*/ */
#define WAITUNTIL(cvp, lp, tp) \ #define WAITUNTIL(cvp, lp, tp) \
isc_condition_waituntil((cvp), (lp), (tp)) isc_condition_waituntil((cvp), (lp), (tp))
#define RWLOCK(lp, t) \ #define RWLOCK(lp, t) \
INSIST(isc_rwlock_lock((lp), (t)) == ISC_R_SUCCESS) RUNTIME_CHECK(isc_rwlock_lock((lp), (t)) == ISC_R_SUCCESS)
#define RWUNLOCK(lp, t) \ #define RWUNLOCK(lp, t) \
INSIST(isc_rwlock_unlock((lp), (t)) == ISC_R_SUCCESS) RUNTIME_CHECK(isc_rwlock_unlock((lp), (t)) == ISC_R_SUCCESS)
#endif /* ISC_UTIL_H */ #endif /* ISC_UTIL_H */