summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2015-11-24 18:39:11 +0100
committerLubomir Rintel <lkundrak@v3.sk>2015-11-24 18:39:11 +0100
commitbaed4a1d2404c887ff664a567f506a9164b0baa0 (patch)
tree2066ab389c01acb49cd9de8ebf6615f66f413e5d
parent730218f1630aa9ae0047951c65fc948b89eefeac (diff)
downloadNetworkManager-lr/sys-devices.tar.gz
Revert "/sys/devices"lr/sys-devices
This reverts commit 730218f1630aa9ae0047951c65fc948b89eefeac.
-rw-r--r--src/platform/tests/test-common.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/platform/tests/test-common.c b/src/platform/tests/test-common.c
index 1050e1ce6f..98280b4527 100644
--- a/src/platform/tests/test-common.c
+++ b/src/platform/tests/test-common.c
@@ -965,19 +965,21 @@ main (int argc, char **argv)
/* Create a writable /sys/devices tree. This makes it possible to run tests
* that modify values via sysfs (such as bridge forward delay). */
- if (mount ("sys", "/sys/devices", "sysfs", 0, NULL) == 0) {
- if (mount (NULL, "/sys/devices", "sysfs", MS_REMOUNT, NULL) != 0) {
- /* Read-write remount failed. Never mind, we're probably just a root in
- * our user NS. */
- if (umount ("/sys/devices") != 0) {
- errsv = errno;
- g_error ("umount(\"/sys/devices\") failed with %s (%d)", strerror (errsv), errsv);
- }
- } else {
- if (mount ("/sys/devices/devices", "/sys/devices", "sysfs", MS_BIND, NULL) != 0) {
- errsv = errno;
- g_error ("mount(\"/sys\") failed with %s (%d)", strerror (errsv), errsv);
- }
+ if (mount ("sys", "/sys/devices", "sysfs", 0, NULL) != 0) {
+ errsv = errno;
+ g_error ("mount(\"/sys/devices\") failed with %s (%d)", strerror (errsv), errsv);
+ }
+ if (mount (NULL, "/sys/devices", "sysfs", MS_REMOUNT, NULL) != 0) {
+ /* Read-write remount failed. Never mind, we're probably just a root in
+ * our user NS. */
+ if (umount ("/sys/devices") != 0) {
+ errsv = errno;
+ g_error ("umount(\"/sys/devices\") failed with %s (%d)", strerror (errsv), errsv);
+ }
+ } else {
+ if (mount ("/sys/devices/devices", "/sys/devices", "sysfs", MS_BIND, NULL) != 0) {
+ errsv = errno;
+ g_error ("mount(\"/sys\") failed with %s (%d)", strerror (errsv), errsv);
}
}
}