Quellcode durchsuchen

linux-v4l2: Fix bashism in v4l2loopback module detection

When /bin/sh isn't bash, the previous line always appears to succeed,
and modinfo's output is not redirected, because it actually runs
modinfo in the background (which always succeeds) then opens and closes
/dev/null without doing anything to it. This causes us to always think
that the v4l2loopback module is installed, even when it isn't.
stump vor 4 Jahren
Ursprung
Commit
eac6604a83
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      plugins/linux-v4l2/linux-v4l2.c

+ 1 - 1
plugins/linux-v4l2/linux-v4l2.c

@@ -31,7 +31,7 @@ static bool v4l2loopback_installed()
 {
 	bool loaded = false;
 
-	int ret = system("modinfo v4l2loopback &>/dev/null");
+	int ret = system("modinfo v4l2loopback >/dev/null 2>&1");
 
 	if (ret == 0)
 		loaded = true;