aboutsummaryrefslogtreecommitdiff
path: root/fdm.c
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2021-02-10 21:03:00 +0000
committerCraig Barnes <craigbarnes@protonmail.com>2021-02-10 21:03:00 +0000
commit1add430b5b6bc2ff616fb859c3b882602ff5222d (patch)
treea7df73c007742a43b4948a8ef4565be5bf18e070 /fdm.c
parentMerge branch 'turn-meson-terminfo-option-into-a-feature' (diff)
parentMark slave_exec() as "noreturn" and convert xassert(false) to BUG(...) (diff)
Merge branch 'xassert-false'
Diffstat (limited to 'fdm.c')
-rw-r--r--fdm.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fdm.c b/fdm.c
index 3394f10c..34d0fbff 100644
--- a/fdm.c
+++ b/fdm.c
@@ -105,16 +105,12 @@ fdm_add(struct fdm *fdm, int fd, int events, fdm_handler_t handler, void *data)
#if defined(_DEBUG)
int flags = fcntl(fd, F_GETFL);
if (!(flags & O_NONBLOCK)) {
- LOG_ERR("FD=%d is in blocking mode", fd);
- xassert(false);
- return false;
+ BUG("FD=%d is in blocking mode", fd);
}
tll_foreach(fdm->fds, it) {
if (it->item->fd == fd) {
- LOG_ERR("FD=%d already registered", fd);
- xassert(false);
- return false;
+ BUG("FD=%d already registered", fd);
}
}
#endif
@@ -251,7 +247,7 @@ hook_priority_to_list(struct fdm *fdm, enum fdm_hook_priority priority)
case FDM_HOOK_PRIORITY_HIGH: return &fdm->hooks_high;
}
- xassert(false);
+ BUG("unhandled priority type");
return NULL;
}