core/platform: silence error about reading sysctl file phys_port_id

It is common that the file exists, but cannot be read
(Operation not supported). So, silence any error when
reading the phys_port_id file.

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller
2014-01-30 16:33:55 +01:00
parent f9022b8fb3
commit 2fd8d40a5a

View File

@@ -1780,10 +1780,7 @@ link_get_physical_port_id (NMPlatform *platform, int ifindex)
return NULL;
path = g_strdup_printf ("/sys/class/net/%s/phys_port_id", ifname);
if (g_file_test (path, G_FILE_TEST_EXISTS))
id = sysctl_get (platform, path, FALSE);
else
id = NULL;
id = sysctl_get (platform, path, TRUE);
g_free (path);
return id;