Replace more system("modprobe")
As we have libkmod available, it is faster and safer than calling
system().
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/lib/sw_sync.c b/lib/sw_sync.c
index 9dc6ec8..c05a787 100644
--- a/lib/sw_sync.c
+++ b/lib/sw_sync.c
@@ -36,6 +36,7 @@
#include <sys/ioctl.h>
#include "igt_debugfs.h"
+#include "igt_kmod.h"
#include "sw_sync.h"
#include "drmtest.h"
#include "ioctl_wrappers.h"
@@ -248,11 +249,16 @@
return fence_info.status;
}
+static void modprobe(const char *driver)
+{
+ igt_kmod_load(driver, "");
+}
+
static bool kernel_has_sw_sync(void)
{
char buf[128];
- igt_ignore_warn(system("/sbin/modprobe -s r sw_sync"));
+ modprobe("sw_sync");
return kernel_sw_sync_path(buf, sizeof(buf));
}