From: Jens Axboe Date: Mon, 9 Oct 2006 14:01:27 +0000 (+0200) Subject: [PATCH] Fixup failure to load io engine object logging X-Git-Tag: fio-1.7~35 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=d4dbaaa821b9d3dd34ca002d1976d4f924a07a47;ds=inline [PATCH] Fixup failure to load io engine object logging Signed-off-by: Jens Axboe --- diff --git a/ioengines.c b/ioengines.c index 723f310d..658b2eb5 100644 --- a/ioengines.c +++ b/ioengines.c @@ -34,12 +34,17 @@ struct ioengine_ops *load_ioengine(struct thread_data *td, char *name) sprintf(engine_lib, "/usr/local/lib/fio/fio-engine-%s.o", engine); dlerror(); dlhandle = dlopen(engine_lib, RTLD_LAZY); - if (!dlhandle) - printf("bla: %s\n", dlerror()); + if (!dlhandle) { + td_vmsg(td, -1, dlerror()); + return NULL; + } ops = dlsym(dlhandle, "ioengine"); - if (!ops) - printf("get ops failed\n"); + if (!ops) { + td_vmsg(td, -1, dlerror()); + dlclose(dlhandle); + return NULL; + } ops->dlhandle = dlhandle; return ops;