Skip to content

Commit

Permalink
Tidy up code
Browse files Browse the repository at this point in the history
  • Loading branch information
trikko committed Dec 25, 2024
1 parent 8bd60db commit dc75827
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions source/serverino/common.d
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit dc75827

Please sign in to comment.