[PATCH] Fixup failure to load io engine object logging
[fio.git] / ioengines.c
index 723f310d6e1bcb8d28a2e6f637212dcfa489f5f8..658b2eb50772771c93ca43fd605238fec3beb81e 100644 (file)
@@ -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);
        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");
 
        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;
 
        ops->dlhandle = dlhandle;
        return ops;