multipath-tools: miscellaneous code cleanups
authorBenjamin Marzinski <bmarzins@redhat.com>
Mon, 3 Aug 2009 22:03:22 +0000 (17:03 -0500)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Tue, 4 Aug 2009 21:34:22 +0000 (23:34 +0200)
io_getevents can return < 0 if it is interrupted, but it doesn't set errno.
This patch sets errno to zero first to avoid printing garbage. Also the
log_thread and uevq_thread functions need to return NULL to avoid compiler
warnings.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
libmultipath/checkers/directio.c
libmultipath/log_pthread.c
libmultipath/uevent.c

index 4728424..44e5eff 100644 (file)
@@ -148,6 +148,7 @@ check_state(int fd, struct directio_context *ct, int sync)
        }
        ct->running++;
 
+       errno = 0;
        r = io_getevents(ct->ioctx, 1L, 1L, &event, &timeout);
 
        if (r < 0 ) {
index 838c06e..ed7b200 100644 (file)
@@ -56,6 +56,7 @@ static void * log_thread (void * et)
 
                flush_logqueue();
        }
+       return NULL;
 }
 
 void log_thread_start (pthread_attr_t *attr)
index 50ed9c9..f18c20b 100644 (file)
@@ -101,6 +101,7 @@ uevq_thread(void * et)
 
                service_uevq();
        }
+       return NULL;
 }
 
 int uevent_listen(int (*uev_trigger)(struct uevent *, void * trigger_data),