~ubuntu-branches/ubuntu/quantal/udev/quantal-updates

« back to all changes in this revision

Viewing changes to libudev/libudev-device.c

  • Committer: Package Import Robot
  • Author(s): Kees Cook
  • Date: 2012-03-04 18:21:15 UTC
  • Revision ID: package-import@ubuntu.com-20120304182115-50h3gixh87p53ffr
Tags: 175-0ubuntu6
Add debian/patches/avoid-exit-deadlock-for-dm_cookie.patch,
debian/libudev0.symbols: do not exit across a pending DM_COOKIE
event to avoid vgchange deadlocks, thanks to Herton R. Krzesinski
(LP: #802626).

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
        bool is_initialized;
90
90
        bool sysattr_list_read;
91
91
        bool db_persist;
 
92
        bool dm_cookie_set;
92
93
};
93
94
 
94
95
/**
345
346
        return 0;
346
347
}
347
348
 
 
349
/**
 
350
 * udev_device_get_dm_cookie_set:
 
351
 * @udev_device: udev device
 
352
 *
 
353
 * Retrieve the status of DM_COOKIE available for this udev device.
 
354
 *
 
355
 * Returns: true if DM_COOKIE was set for this device, false otherwise
 
356
 **/
 
357
UDEV_EXPORT bool udev_device_get_dm_cookie_set(struct udev_device *udev_device)
 
358
{
 
359
        if (udev_device == NULL)
 
360
                return NULL;
 
361
        return udev_device->dm_cookie_set;
 
362
}
 
363
 
 
364
static int udev_device_set_dm_cookie_set(struct udev_device *udev_device)
 
365
{
 
366
        udev_device->dm_cookie_set = true;
 
367
        return 0;
 
368
}
 
369
 
348
370
struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value)
349
371
{
350
372
        udev_device->envp_uptodate = false;
457
479
                udev_device_set_ifindex(udev_device, strtoull(&property[8], NULL, 10));
458
480
        } else if (strncmp(property, "DEVMODE=", 8) == 0) {
459
481
                udev_device_set_devnode_mode(udev_device, strtoul(&property[8], NULL, 8));
 
482
        } else if (strncmp(property, "DM_COOKIE=", 10) == 0) {
 
483
                udev_device_set_dm_cookie_set(udev_device);
 
484
                udev_device_add_property_from_string(udev_device, property);
460
485
        } else {
461
486
                udev_device_add_property_from_string(udev_device, property);
462
487
        }