From: Hannes Reinecke <hare@suse.de>
To: Christophe Varoqui <christophe.varoqui@gmail.com>
Cc: Hannes Reinecke <hare@suse.com>, dm-devel@redhat.com
Subject: libmultipath: use poll() in uevent_listen()
Date: Wed, 11 May 2016 12:35:53 +0200 [thread overview]
Message-ID: <1462962953-9492-1-git-send-email-hare@suse.de> (raw)
As we're not modifying the signal mask anymore we can switch
back to normal 'poll' instead of 'ppoll'.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
libmultipath/uevent.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c
index fbe9c44..454b819 100644
--- a/libmultipath/uevent.c
+++ b/libmultipath/uevent.c
@@ -477,7 +477,6 @@ int uevent_listen(struct udev *udev)
int fd, fd_ep = -1, socket_flags, events;
int need_failback = 1;
int timeout = 30;
- sigset_t mask;
LIST_HEAD(uevlisten_tmp);
/*
@@ -528,22 +527,20 @@ int uevent_listen(struct udev *udev)
goto out;
}
- pthread_sigmask(SIG_SETMASK, NULL, &mask);
events = 0;
while (1) {
struct uevent *uev;
struct udev_device *dev;
struct pollfd ev_poll;
- struct timespec poll_timeout;
+ int poll_timeout;
int fdcount;
memset(&ev_poll, 0, sizeof(struct pollfd));
ev_poll.fd = fd;
ev_poll.events = POLLIN;
- memset(&poll_timeout, 0, sizeof(struct timespec));
- poll_timeout.tv_sec = timeout;
+ poll_timeout = timeout * 1000;
errno = 0;
- fdcount = ppoll(&ev_poll, 1, &poll_timeout, &mask);
+ fdcount = poll(&ev_poll, 1, poll_timeout);
if (fdcount && ev_poll.revents & POLLIN) {
timeout = 0;
dev = udev_monitor_receive_device(monitor);
--
2.6.6
next reply other threads:[~2016-05-11 10:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-11 10:35 Hannes Reinecke [this message]
2016-05-11 17:19 ` libmultipath: use poll() in uevent_listen() Benjamin Marzinski
2016-05-11 17:37 ` Christophe Varoqui
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=1462962953-9492-1-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=christophe.varoqui@gmail.com \
--cc=dm-devel@redhat.com \
--cc=hare@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.