~ubuntu-branches/ubuntu/vivid/initramfs-tools/vivid

« back to all changes in this revision

Viewing changes to src/wait-for-root.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-08-26 14:23:10 UTC
  • Revision ID: package-import@ubuntu.com-20130826142310-gaedjoy77f8pzpmg
Tags: 0.103ubuntu1
src/wait-for-root.c: udev_monitor_receive_device() might still return NULL
even with a blocking socket if recvmsg() fails with ENOBUFS. Retry every
second in that case. Thanks to Tetsuo Handa for debugging this and the
patch! (LP: #1215911)

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
        /* When the device doesn't exist yet, or is still being processed
97
97
         * by udev, use the monitor socket to wait it to be done.
98
98
         */
99
 
        while ((udev_device = udev_monitor_receive_device (udev_monitor)) != NULL) {
 
99
        while (1) {
 
100
                /* even though we use a blocking socket this might still fail
 
101
                 * due to ENOBUFS or similar. */
 
102
                while ((udev_device = udev_monitor_receive_device (udev_monitor)) == NULL)
 
103
                        sleep (1);
100
104
                if (matching_device (udev_device, devpath)) {
101
105
                        type = udev_device_get_property_value (udev_device, "ID_FS_TYPE");
102
106
                        if (type) {