aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2010-07-15 13:25:23 -0400
committerBill Nottingham <notting@redhat.com>2010-07-15 13:25:23 -0400
commit5848b14d509a717b2396304f6bb1cb03b2549777 (patch)
tree755747e4f3a174c1bfb7dc590d919e978d30e002 /src
parent0b7e695718431d8a97c6c6a2e0bdc89cd7335a61 (diff)
downloadinitscripts-5848b14d509a717b2396304f6bb1cb03b2549777.tar
initscripts-5848b14d509a717b2396304f6bb1cb03b2549777.tar.gz
initscripts-5848b14d509a717b2396304f6bb1cb03b2549777.tar.bz2
initscripts-5848b14d509a717b2396304f6bb1cb03b2549777.tar.xz
initscripts-5848b14d509a717b2396304f6bb1cb03b2549777.zip
rename_device: fix s390 subchannel reading
Diffstat (limited to 'src')
-rw-r--r--src/rename_device.c7
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);