From dc75827a813a6999e44a2c9422ccb9477826153c Mon Sep 17 00:00:00 2001 From: Andrea Fontana Date: Wed, 25 Dec 2024 22:23:29 +0100 Subject: [PATCH] Tidy up code --- source/serverino/common.d | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/serverino/common.d b/source/serverino/common.d index 64a8ed8..2cc8701 100644 --- a/source/serverino/common.d +++ b/source/serverino/common.d @@ -575,18 +575,16 @@ version(Posix) { import core.sys.posix.dlfcn; - extern (C) int dll(); - kqueue_handle = dlopen("libkqueue.so", RTLD_LAZY); + if (!kqueue_handle) - { - assert(false, "Failed to load libkqueue.so"); - } + assert(false, "Failed to load libkqueue.so. Please install the libkqueue library or use one of the other backends (select or epoll)"); kqueue = cast(typeof(kqueue))dlsym(kqueue_handle, "kqueue"); kevent_f = cast(typeof(kevent_f))dlsym(kqueue_handle, "kevent"); - assert(kqueue && kevent_f, "Failed to load kqueue or kevent functions"); + if(!kqueue || !kevent_f) + assert(false, "Failed to load kqueue or kevent functions"); } shared static ~this()