diff options
author | Harald Hoyer <harald@redhat.com> | 2010-07-15 13:25:23 -0400 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2010-07-15 13:25:47 -0400 |
commit | 077be9f3d0d2ae1a94964e47a87550c18fa370cb (patch) | |
tree | 9244e5991b92e4e15f112c7e64fbcfd2f0b69a76 /src | |
parent | b3f6e39adc4627af2f781cff87f961246fbe6ac0 (diff) | |
download | initscripts-077be9f3d0d2ae1a94964e47a87550c18fa370cb.tar initscripts-077be9f3d0d2ae1a94964e47a87550c18fa370cb.tar.gz initscripts-077be9f3d0d2ae1a94964e47a87550c18fa370cb.tar.bz2 initscripts-077be9f3d0d2ae1a94964e47a87550c18fa370cb.tar.xz initscripts-077be9f3d0d2ae1a94964e47a87550c18fa370cb.zip |
rename_device: fix s390 subchannel reading
Diffstat (limited to 'src')
-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); |