summaryrefslogtreecommitdiff
path: root/udev/udevadm-settle.c
AgeCommit message (Collapse)Author
2009-03-12udevadm: settle - synchronise with the udev daemonScott James Remnant
There's still a slight race condition when using udevadm settle, if the udev daemon has a pending inotify event but hasn't yet generated the "change" uevent for it, the kernel and udev sequence numbers will match and settle will exit. Now udevadm settle will send a control message to udevd, which will respond by sending SIGUSR1 back to the waiting udevadm settle once it has completed the main loop iteration in which it received the control message. If there were no pending inotify events, this will simply wake up the udev daemon and allow settle to continue. If there are pending inotify events, they are handled first in the main loop so when settle is continued they will have been turned into uevents and the kernel sequence number will have been incremented. Since the inotify event is pending for udevd when the close() system call returns (it's queued as part of the kernel handling for that system call), and since the kernel sequence number is incremented by writing to the uevent file (as udevd does), this solves the race. When the settle continues, if there were pending inotify events that udevd had not read, they are now pending uevents which settle can wait for. Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-03-11udevadm: settle - use timeout signal, instead of loop counterKay Sievers
2009-03-07udevadm: add text for new options to command and man pageKay Sievers
2009-03-04udevadm: settle - add --seq-start= --seq-end=Kay Sievers
It might be useful in some cases not to wait for "all" events. $ read START < /sys/kernel/uevent_seqnum $ (do something which may create uevents) $ udevadm settle --seq-start=$START
2009-02-05test: add test for empty and non-existent ATTRKay Sievers
2009-01-23udevadm: settle - fix typoKay Sievers
2008-12-08udevadm: settle - allow --timeout=0 and --quietKay Sievers
2008-10-24fix uninitialized variable warningsKay Sievers
2008-10-02use no_argument, required_argument, optional_argument in longoptsKay Sievers
2008-10-01udevadm: settle - use libudev queueKay Sievers
2008-09-10use size definitions from libudevKay Sievers
2008-09-10get rid of udev_sysdeps.cKay Sievers
2008-09-10update file headersKay Sievers
2008-09-08move udev_ctrl to libudev-privateKay Sievers
2008-09-06use libudev code, unify logging, pass udev context around everywhereKay Sievers
2008-09-04udevadm: move init from commands to udevadmKay Sievers
2008-09-03udevadm: rename internal functions to udevadm_*Kay Sievers
2008-09-03udevadm: rename source filesKay Sievers