From 077be9f3d0d2ae1a94964e47a87550c18fa370cb Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 15 Jul 2010 13:25:23 -0400 Subject: rename_device: fix s390 subchannel reading --- src/rename_device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rename_device.c b/src/rename_device.c index 804c8433..197fbdb3 100644 --- a/src/rename_device.c +++ b/src/rename_device.c @@ -198,12 +198,13 @@ char *get_hwaddr(char *device) { char *path = NULL; char *contents = NULL; - if (asprintf(&path, "/sys/class/net/%s/address", device) == -1) - return NULL; - #if defined(__s390__) || defined(__s390x__) + if (asprintf(&path, "/sys/class/net/%s/device/.", device) == -1) + return NULL; contents = read_subchannels(path); #else + if (asprintf(&path, "/sys/class/net/%s/address", device) == -1) + return NULL; g_file_get_contents(path, &contents, NULL, NULL); #endif free(path); -- cgit v1.2.1