]> sourceware.org Git - lvm2.git/commitdiff
dmeventd: use matching function
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 14 Oct 2015 12:19:47 +0000 (14:19 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 14 Oct 2015 12:25:27 +0000 (14:25 +0200)
Respect lvm2_log_fn prototype. The idea of 'reusing' print_log with
plain cast is causing very strange crashes with some older 'gcc'  compilers.
So just do it cleanly...

daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c

index e3d832168251dee0438f69fb664f009a59848f31..49bfb568aa60cda72d9460463b107eff9fd0f3eb 100644 (file)
@@ -34,6 +34,12 @@ static void *_lvm_handle = NULL;
 
 DM_EVENT_LOG_FN("lvm")
 
+static void lvm2_print_log(int level, const char *file, int line,
+                          int dm_errno_or_class, const char *msg)
+{
+       print_log(level, file, line, dm_errno_or_class, "%s", msg);
+}
+
 /*
  * Currently only one event can be processed at a time.
  */
@@ -56,7 +62,7 @@ int dmeventd_lvm2_init(void)
        pthread_mutex_lock(&_register_mutex);
 
        if (!_lvm_handle) {
-               lvm2_log_fn((lvm2_log_fn_t)print_log);
+               lvm2_log_fn(lvm2_print_log);
 
                if (!(_lvm_handle = lvm2_init()))
                        goto out;
This page took 0.035691 seconds and 5 git commands to generate.