Explorar o código

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 %!s(int64=4) %!d(string=hai) anos
pai
achega
eac6604a83
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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;