Linux Device Mapper development
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: [PATCH 5/5] multipath-tools: miscellaneous code cleanups
Date: Mon, 3 Aug 2009 17:03:22 -0500	[thread overview]
Message-ID: <20090803220321.GV15326@ether.msp.redhat.com> (raw)

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 |    1 +
 libmultipath/log_pthread.c       |    1 +
 libmultipath/uevent.c            |    1 +
 3 files changed, 3 insertions(+)

Index: multipath-tools/libmultipath/checkers/directio.c
===================================================================
--- multipath-tools.orig/libmultipath/checkers/directio.c
+++ 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 ) {
Index: multipath-tools/libmultipath/log_pthread.c
===================================================================
--- multipath-tools.orig/libmultipath/log_pthread.c
+++ 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)
Index: multipath-tools/libmultipath/uevent.c
===================================================================
--- multipath-tools.orig/libmultipath/uevent.c
+++ 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),

                 reply	other threads:[~2009-08-03 22:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090803220321.GV15326@ether.msp.redhat.com \
    --to=bmarzins@redhat.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox