~ubuntu-branches/ubuntu/trusty/systemd/trusty

« back to all changes in this revision

Viewing changes to src/core/device.c

Tags: upstream-202
ImportĀ upstreamĀ versionĀ 202

Show diffs side-by-side

added added

removed removed

Lines of Context:
312
312
static int device_process_new_device(Manager *m, struct udev_device *dev, bool update_state) {
313
313
        const char *sysfs, *dn;
314
314
        struct udev_list_entry *item = NULL, *first = NULL;
 
315
        int r;
315
316
 
316
317
        assert(m);
317
318
 
319
320
                return -ENOMEM;
320
321
 
321
322
        /* Add the main unit named after the sysfs path */
322
 
        device_update_unit(m, dev, sysfs, true);
 
323
        r = device_update_unit(m, dev, sysfs, true);
 
324
        if (r < 0)
 
325
                return r;
323
326
 
324
327
        /* Add an additional unit for the device node */
325
328
        if ((dn = udev_device_get_devnode(dev)))
477
480
}
478
481
 
479
482
static int device_enumerate(Manager *m) {
480
 
        struct epoll_event ev;
481
483
        int r;
482
484
        struct udev_enumerate *e = NULL;
483
485
        struct udev_list_entry *item = NULL, *first = NULL;
485
487
        assert(m);
486
488
 
487
489
        if (!m->udev) {
 
490
                struct epoll_event ev;
 
491
 
488
492
                if (!(m->udev = udev_new()))
489
493
                        return -ENOMEM;
490
494