diff options
| author | Michael Biebl <biebl@debian.org> | 2016-04-06 00:46:19 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2016-04-06 00:46:19 +0200 |
| commit | 2bfb3eb7d0323e69affca154395f51d8b577414d (patch) | |
| tree | e3130a5146441296df6d08a0f4ac7222a854c8f8 /src/devices/nm-device-factory.c | |
| parent | d9c99a29a0d3384c9c3d2adce430f5cb1134ab6a (diff) | |
Imported Upstream version 1.1.93 upstream/1.1.93
Diffstat (limited to 'src/devices/nm-device-factory.c')
| -rw-r--r-- | src/devices/nm-device-factory.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/devices/nm-device-factory.c b/src/devices/nm-device-factory.c index 5ce4333f..9dfa9bcb 100644 --- a/src/devices/nm-device-factory.c +++ b/src/devices/nm-device-factory.c @@ -91,6 +91,8 @@ nm_device_factory_create_device (NMDeviceFactory *factory, const NMLinkType *link_types = NULL; const char **setting_types = NULL; int i; + NMDevice *device; + gboolean ignore = FALSE; g_return_val_if_fail (factory, NULL); g_return_val_if_fail (iface && *iface, NULL); @@ -99,6 +101,8 @@ nm_device_factory_create_device (NMDeviceFactory *factory, nm_device_factory_get_supported_types (factory, &link_types, &setting_types); + NM_SET_OUT (out_ignore, FALSE); + if (plink) { g_return_val_if_fail (strcmp (iface, plink->name) == 0, NULL); @@ -137,7 +141,20 @@ nm_device_factory_create_device (NMDeviceFactory *factory, return NULL; } - return interface->create_device (factory, iface, plink, connection, out_ignore); + device = interface->create_device (factory, iface, plink, connection, &ignore); + NM_SET_OUT (out_ignore, ignore); + if (!device) { + if (ignore) { + g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED, + "Device factory %s ignores device %s", + G_OBJECT_TYPE_NAME (factory), iface); + } else { + g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED, + "Device factory %s failed to create device %s", + G_OBJECT_TYPE_NAME (factory), iface); + } + } + return device; } const char * |