diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-libudev.c | 10 | ||||
-rw-r--r-- | src/test/test-udev.c | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/test/test-libudev.c b/src/test/test-libudev.c index 6161fb3e31..f5c7ae2c30 100644 --- a/src/test/test-libudev.c +++ b/src/test/test-libudev.c @@ -434,7 +434,6 @@ int main(int argc, char *argv[]) const char *syspath = "/devices/virtual/mem/null"; const char *subsystem = NULL; char path[1024]; - const char *str; udev = udev_new(); printf("context: %p\n", udev); @@ -474,14 +473,9 @@ int main(int argc, char *argv[]) } } - str = udev_get_sys_path(udev); - printf("sys_path: '%s'\n", str); - str = udev_get_dev_path(udev); - printf("dev_path: '%s'\n", str); - /* add sys path if needed */ - if (strncmp(syspath, udev_get_sys_path(udev), strlen(udev_get_sys_path(udev))) != 0) { - snprintf(path, sizeof(path), "%s%s", udev_get_sys_path(udev), syspath); + if (strncmp(syspath, "/sys", strlen("/sys")) != 0) { + snprintf(path, sizeof(path), "/sys/%s", syspath); syspath = path; } diff --git a/src/test/test-udev.c b/src/test/test-udev.c index 150cb16a31..b843e5f648 100644 --- a/src/test/test-udev.c +++ b/src/test/test-udev.c @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) rules = udev_rules_new(udev, 1); - util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL); + util_strscpyl(syspath, sizeof(syspath), TEST_PREFIX "/sys", devpath, NULL); dev = udev_device_new_from_syspath(udev, syspath); if (dev == NULL) { log_debug("unknown device '%s'\n", devpath); |