From 2328307a8f353078dbbebf242007271153e18cd1 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Wed, 6 Jan 1999 20:02:52 +0000 Subject: [PATCH] use RUNTIME_CHECK instead of INSIST where appropriate --- lib/isc/timer.c | 4 ++-- lib/isc/unix/socket.c | 8 ++++---- lib/isc/util.h | 24 +++++++++++++----------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/isc/timer.c b/lib/isc/timer.c index 9b59743ede..3042decec9 100644 --- a/lib/isc/timer.c +++ b/lib/isc/timer.c @@ -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 * purpose with or without fee is hereby granted, provided that the above @@ -499,7 +499,7 @@ run(void *uap) { LOCK(&manager->lock); while (!manager->done) { - INSIST(isc_time_get(&now) == ISC_R_SUCCESS); + RUNTIME_CHECK(isc_time_get(&now) == ISC_R_SUCCESS); XTRACETIME("running", now); diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 12eac41aa3..d956f7980d 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -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 * purpose with or without fee is hereby granted, provided that the above @@ -41,7 +41,7 @@ #endif #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); #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); } - INSIST(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[0]) == ISC_R_SUCCESS); + RUNTIME_CHECK(make_nonblock(manager->pipe_fds[1]) == ISC_R_SUCCESS); /* * Set up initial state for the select loop diff --git a/lib/isc/util.h b/lib/isc/util.h index d0b2c2a7dd..d6eae13e58 100644 --- a/lib/isc/util.h +++ b/lib/isc/util.h @@ -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 * purpose with or without fee is hereby granted, provided that the above @@ -18,6 +18,8 @@ #ifndef ISC_UTIL_H #define ISC_UTIL_H 1 +#include + /*** *** General Macros. ***/ @@ -26,32 +28,32 @@ * We use macros instead of calling the routines directly because * the capital letters make the locking stand out. * - * We INSIST that they succeed since there's no way for us to continue - * if they fail. + * We RUNTIME_CHECK for success since in general there's no way + * for us to continue if they fail. */ #define LOCK(lp) \ - INSIST(isc_mutex_lock((lp)) == ISC_R_SUCCESS) + RUNTIME_CHECK(isc_mutex_lock((lp)) == ISC_R_SUCCESS) #define UNLOCK(lp) \ - INSIST(isc_mutex_unlock((lp)) == ISC_R_SUCCESS) + RUNTIME_CHECK(isc_mutex_unlock((lp)) == ISC_R_SUCCESS) #define BROADCAST(cvp) \ - INSIST(isc_condition_broadcast((cvp)) == ISC_R_SUCCESS) + RUNTIME_CHECK(isc_condition_broadcast((cvp)) == ISC_R_SUCCESS) #define SIGNAL(cvp) \ - INSIST(isc_condition_signal((cvp)) == ISC_R_SUCCESS) + RUNTIME_CHECK(isc_condition_signal((cvp)) == ISC_R_SUCCESS) #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 - * don't INSIST the result is ISC_R_SUCCESS. + * don't RUNTIME_CHECK the result. */ #define WAITUNTIL(cvp, lp, tp) \ isc_condition_waituntil((cvp), (lp), (tp)) #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) \ - INSIST(isc_rwlock_unlock((lp), (t)) == ISC_R_SUCCESS) + RUNTIME_CHECK(isc_rwlock_unlock((lp), (t)) == ISC_R_SUCCESS) #endif /* ISC_UTIL_H */