[libvirt] [PATCH libvirt-glib 4/5] tests: Don't rely on non-portable paths

Andrea Bolognani abologna at redhat.com
Wed Sep 20 17:54:49 UTC 2017


The test-events program sets up a watch on /bin/true; however,
that path is not portable: FreeBSD uses /usr/bin/true for example.

Remove the portability issue by using /dev/null instead.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 tests/test-events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test-events.c b/tests/test-events.c
index 0c0e929..6845243 100644
--- a/tests/test-events.c
+++ b/tests/test-events.c
@@ -98,7 +98,7 @@ static gboolean test_watch(gpointer user_data G_GNUC_UNUSED)
 static void test_remove_disabled_watch(void)
 {
     main_loop = g_main_loop_new(NULL, FALSE);
-    watch_fd = open("/bin/true", O_RDONLY);
+    watch_fd = open("/dev/null", O_RDONLY);
     g_idle_add(test_watch, NULL);
     g_main_loop_run(main_loop);
     g_main_loop_unref(main_loop);
-- 
2.13.5




More information about the libvir-list mailing list