Skip to contentSkip to conversation

multipath-tools: miscellaneous code cleanups

PATCH New Benjamin Marzinski 1 participant 1 message Aug 3, 2009 Device mapper

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

PATCH 5/5 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.

---
 libmultipath/checkers/directio.c |    1 +
 libmultipath/log_pthread.c       |    1 +
 libmultipath/uevent.c            |    1 +
 3 files changed, 3 insertions(+)
libmultipath/checkers/directio.c +1 -0
Index: multipath-tools/libmultipath/checkers/directio.c
===================================================================
@@ -148,6 +148,7 @@ check_state(int fd, struct directio_cont
 	}
 	ct->running++;
 
+	errno = 0;
 	r = io_getevents(ct->ioctx, 1L, 1L, &event, &timeout);
 
 	if (r < 0 ) {
libmultipath/log_pthread.c +1 -0
Index: multipath-tools/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)
libmultipath/uevent.c +1 -0
Index: multipath-tools/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),