Browse Source

libobs/util: Fix os_process_pipe_create on Linux

This fixes a regression on Linux, introduced in commit 9bc3082.

According to the POSIX specification for the exec family of commands, 
"The first argument is the filename or pathname of the executable to 
be executed". This was done correctly before, but the above commit 
removed "sh" from the arguments, breaking the pipe function on Linux.
Miha Frangež 7 months ago
parent
commit
1fc94ecde5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libobs/util/pipe-posix.c

+ 1 - 1
libobs/util/pipe-posix.c

@@ -124,7 +124,7 @@ os_process_pipe_t *os_process_pipe_create(const char *cmd_line, const char *type
 	if (!cmd_line)
 		return NULL;
 
-	char *argv[3] = {"-c", (char *)cmd_line, NULL};
+	char *argv[4] = {"sh", "-c", (char *)cmd_line, NULL};
 	return os_process_pipe_create_internal("/bin/sh", argv, type);
 }