summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-05-18 18:58:04 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-05-18 18:58:04 +0200
commitbd8e0e387d844bd5b7d8c29ca2871c824c0fc146 (patch)
tree03a4ef0efdcdd782b6cf01593ec599f0d72418ee /udev
parentf0ed90b7678045759ffa2a44d2b4cac96968b077 (diff)
udevadm: settle: wake up more often if --seq-start= or --exit-if-exists= is used
Diffstat (limited to 'udev')
-rw-r--r--udev/udevadm-settle.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/udev/udevadm-settle.c b/udev/udevadm-settle.c
index b717ae60de..053a3bba33 100644
--- a/udev/udevadm-settle.c
+++ b/udev/udevadm-settle.c
@@ -183,8 +183,15 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[])
}
if (pfd[0].fd >= 0) {
- /* wake up once every second, or whenever the queue file gets gets closed */
- if (poll(pfd, 1, 1000) > 0 && pfd[0].revents & POLLIN) {
+ int delay;
+
+ /* wake up after delay, or immediately after the queue is rebuilt */
+
+ if (exists != NULL || start > 0)
+ delay = 100;
+ else
+ delay = 1000;
+ if (poll(pfd, 1, delay) > 0 && pfd[0].revents & POLLIN) {
char buf[sizeof(struct inotify_event) + PATH_MAX];
read(pfd[0].fd, buf, sizeof(buf));