diff options
Diffstat (limited to 'usr.bin/dig/lib/isc/unix')
| -rw-r--r-- | usr.bin/dig/lib/isc/unix/app.c | 33 | ||||
| -rw-r--r-- | usr.bin/dig/lib/isc/unix/errno2result.c | 4 | ||||
| -rw-r--r-- | usr.bin/dig/lib/isc/unix/errno2result.h | 4 | ||||
| -rw-r--r-- | usr.bin/dig/lib/isc/unix/socket.c | 18 |
4 files changed, 29 insertions, 30 deletions
diff --git a/usr.bin/dig/lib/isc/unix/app.c b/usr.bin/dig/lib/isc/unix/app.c index 62535523261..f9a98b11642 100644 --- a/usr.bin/dig/lib/isc/unix/app.c +++ b/usr.bin/dig/lib/isc/unix/app.c @@ -23,7 +23,6 @@ #include <time.h> #include <isc/app.h> -#include <isc/boolean.h> #include <isc/event.h> #include <string.h> @@ -47,13 +46,13 @@ typedef struct isc_appctx { isc_eventlist_t on_run; - isc_boolean_t shutdown_requested; - isc_boolean_t running; + int shutdown_requested; + int running; /*! * We assume that 'want_shutdown' can be read and written atomically. */ - isc_boolean_t want_shutdown; + int want_shutdown; isc_taskmgr_t *taskmgr; isc_socketmgr_t *socketmgr; @@ -73,9 +72,9 @@ isc_app_ctxstart(isc_appctx_t *ctx) { ISC_LIST_INIT(ctx->on_run); - ctx->shutdown_requested = ISC_FALSE; - ctx->running = ISC_FALSE; - ctx->want_shutdown = ISC_FALSE; + ctx->shutdown_requested = 0; + ctx->running = 0; + ctx->want_shutdown = 0; if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { UNEXPECTED_ERROR(__FILE__, __LINE__, @@ -147,15 +146,15 @@ evloop(isc_appctx_t *ctx) { struct timespec when, now, diff, zero ={0, 0}; struct timeval tv, *tvp; isc_socketwait_t *swait; - isc_boolean_t readytasks; - isc_boolean_t call_timer_dispatch = ISC_FALSE; + int readytasks; + int call_timer_dispatch = 0; readytasks = isc_taskmgr_ready(ctx->taskmgr); if (readytasks) { tv.tv_sec = 0; tv.tv_usec = 0; tvp = &tv; - call_timer_dispatch = ISC_TRUE; + call_timer_dispatch = 1; } else { result = isc_timermgr_nextevent(ctx->timermgr, &when); if (result != ISC_R_SUCCESS) @@ -164,7 +163,7 @@ evloop(isc_appctx_t *ctx) { clock_gettime(CLOCK_MONOTONIC, &now); timespecsub(&when, &now, &diff); if (timespeccmp(&diff, &zero, <=)) { - call_timer_dispatch = ISC_TRUE; + call_timer_dispatch = 1; memset(&tv, 0, sizeof(tv)); } else TIMESPEC_TO_TIMEVAL(&tv, &diff); @@ -206,7 +205,7 @@ isc_app_ctxrun(isc_appctx_t *ctx) { isc_task_t *task; if (!ctx->running) { - ctx->running = ISC_TRUE; + ctx->running = 1; /* * Post any on-run events (in FIFO order). @@ -235,21 +234,21 @@ isc_app_run(void) { static isc_result_t isc_app_ctxshutdown(isc_appctx_t *ctx) { - isc_boolean_t want_kill = ISC_TRUE; + int want_kill = 1; REQUIRE(ctx->running); if (ctx->shutdown_requested) - want_kill = ISC_FALSE; + want_kill = 0; else - ctx->shutdown_requested = ISC_TRUE; + ctx->shutdown_requested = 1; if (want_kill) { if (ctx != &isc_g_appctx) /* BIND9 internal, but using multiple contexts */ - ctx->want_shutdown = ISC_TRUE; + ctx->want_shutdown = 1; else { - ctx->want_shutdown = ISC_TRUE; + ctx->want_shutdown = 1; } } diff --git a/usr.bin/dig/lib/isc/unix/errno2result.c b/usr.bin/dig/lib/isc/unix/errno2result.c index 8675d9b4bb6..32b5aec1ce6 100644 --- a/usr.bin/dig/lib/isc/unix/errno2result.c +++ b/usr.bin/dig/lib/isc/unix/errno2result.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: errno2result.c,v 1.4 2020/02/13 21:34:06 jung Exp $ */ +/* $Id: errno2result.c,v 1.5 2020/09/14 08:40:44 florian Exp $ */ /*! \file */ @@ -33,7 +33,7 @@ * not already there. */ isc_result_t -isc___errno2result(int posixerrno, isc_boolean_t dolog, +isc___errno2result(int posixerrno, int dolog, const char *file, unsigned int line) { switch (posixerrno) { diff --git a/usr.bin/dig/lib/isc/unix/errno2result.h b/usr.bin/dig/lib/isc/unix/errno2result.h index c650e3db7be..0b821af649b 100644 --- a/usr.bin/dig/lib/isc/unix/errno2result.h +++ b/usr.bin/dig/lib/isc/unix/errno2result.h @@ -23,10 +23,10 @@ #include <isc/types.h> -#define isc__errno2result(x) isc___errno2result(x, ISC_TRUE, __FILE__, __LINE__) +#define isc__errno2result(x) isc___errno2result(x, 1, __FILE__, __LINE__) isc_result_t -isc___errno2result(int posixerrno, isc_boolean_t dolog, +isc___errno2result(int posixerrno, int dolog, const char *file, unsigned int line); #endif /* UNIX_ERRNO2RESULT_H */ diff --git a/usr.bin/dig/lib/isc/unix/socket.c b/usr.bin/dig/lib/isc/unix/socket.c index 56851275b90..42aad2efae6 100644 --- a/usr.bin/dig/lib/isc/unix/socket.c +++ b/usr.bin/dig/lib/isc/unix/socket.c @@ -1417,7 +1417,7 @@ isc_socket_attach(isc_socket_t *sock0, isc_socket_t **socketp) { void isc_socket_detach(isc_socket_t **socketp) { isc_socket_t *sock; - isc_boolean_t kill_socket = ISC_FALSE; + int kill_socket = 0; REQUIRE(socketp != NULL); sock = (isc_socket_t *)*socketp; @@ -1425,7 +1425,7 @@ isc_socket_detach(isc_socket_t **socketp) { REQUIRE(sock->references > 0); sock->references--; if (sock->references == 0) - kill_socket = ISC_TRUE; + kill_socket = 1; if (kill_socket) destroy(&sock); @@ -1679,11 +1679,11 @@ internal_send(isc_task_t *me, isc_event_t *ev) { * and unlocking twice if both reads and writes are possible. */ static void -process_fd(isc_socketmgr_t *manager, int fd, isc_boolean_t readable, - isc_boolean_t writeable) +process_fd(isc_socketmgr_t *manager, int fd, int readable, + int writeable) { isc_socket_t *sock; - isc_boolean_t unwatch_read = ISC_FALSE, unwatch_write = ISC_FALSE; + int unwatch_read = 0, unwatch_write = 0; /* * If the socket is going to be closed, don't do more I/O. @@ -1697,18 +1697,18 @@ process_fd(isc_socketmgr_t *manager, int fd, isc_boolean_t readable, sock = manager->fds[fd]; if (readable) { if (sock == NULL) { - unwatch_read = ISC_TRUE; + unwatch_read = 1; goto check_write; } if (!SOCK_DEAD(sock)) { dispatch_recv(sock); } - unwatch_read = ISC_TRUE; + unwatch_read = 1; } check_write: if (writeable) { if (sock == NULL) { - unwatch_write = ISC_TRUE; + unwatch_write = 1; goto unlock_fd; } if (!SOCK_DEAD(sock)) { @@ -1717,7 +1717,7 @@ check_write: else dispatch_send(sock); } - unwatch_write = ISC_TRUE; + unwatch_write = 1; } unlock_fd: |
