diff options
author | Harald Hoyer <harald@redhat.com> | 2010-07-15 08:34:20 +0200 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2010-07-15 08:34:20 +0200 |
commit | 06fc83db4e0e693d64ea0fa0b58c935863908d8b (patch) | |
tree | 9244e5991b92e4e15f112c7e64fbcfd2f0b69a76 | |
parent | b3f6e39adc4627af2f781cff87f961246fbe6ac0 (diff) | |
download | initscripts-06fc83db4e0e693d64ea0fa0b58c935863908d8b.tar initscripts-06fc83db4e0e693d64ea0fa0b58c935863908d8b.tar.gz initscripts-06fc83db4e0e693d64ea0fa0b58c935863908d8b.tar.bz2 initscripts-06fc83db4e0e693d64ea0fa0b58c935863908d8b.tar.xz initscripts-06fc83db4e0e693d64ea0fa0b58c935863908d8b.zip |
rename_device: fix s390 subchannel reading
-rw-r--r-- | src/rename_device.c | 7 |
1 files changed, 4 insertions, 3 deletions
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); |