diff options
author | Benjamin Marzinski <bmarzins@redhat.com> | 2009-08-03 17:03:22 -0500 |
---|---|---|
committer | Christophe Varoqui <christophe.varoqui@free.fr> | 2009-08-04 23:34:22 +0200 |
commit | 761c66f4aaba5d04a3106c7d55c8abfb756469b2 (patch) | |
tree | 962ca245cba59ce54f782ae5ed74af4f5610be84 | |
parent | 2f9c759d35aeda46951891343a138663313a3d63 (diff) | |
download | multipath-tools-761c66f4aaba5d04a3106c7d55c8abfb756469b2.tar.gz multipath-tools-761c66f4aaba5d04a3106c7d55c8abfb756469b2.tar.bz2 multipath-tools-761c66f4aaba5d04a3106c7d55c8abfb756469b2.zip |
multipath-tools: miscellaneous code cleanups
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>
-rw-r--r-- | libmultipath/checkers/directio.c | 1 | ||||
-rw-r--r-- | libmultipath/log_pthread.c | 1 | ||||
-rw-r--r-- | libmultipath/uevent.c | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/libmultipath/checkers/directio.c b/libmultipath/checkers/directio.c index 4728424..44e5eff 100644 --- a/libmultipath/checkers/directio.c +++ b/libmultipath/checkers/directio.c @@ -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 ) { diff --git a/libmultipath/log_pthread.c b/libmultipath/log_pthread.c index 838c06e..ed7b200 100644 --- a/libmultipath/log_pthread.c +++ b/libmultipath/log_pthread.c @@ -56,6 +56,7 @@ static void * log_thread (void * et) flush_logqueue(); } + return NULL; } void log_thread_start (pthread_attr_t *attr) diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c index 50ed9c9..f18c20b 100644 --- a/libmultipath/uevent.c +++ b/libmultipath/uevent.c @@ -101,6 +101,7 @@ uevq_thread(void * et) service_uevq(); } + return NULL; } int uevent_listen(int (*uev_trigger)(struct uevent *, void * trigger_data), |