diff options
author | Daniel Jones <admin@danieljon.es> | 2019-12-01 15:48:26 +1030 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2019-12-01 15:48:26 +1030 |
commit | cb2f99ea8be471546fcefbb09defffab6221e902 (patch) | |
tree | e2875cdd0d3e63b8246ef6472e4aee623ffeccc3 | |
parent | cea6e51199c9748de48f37e82fd9b8b863dc55fc (diff) | |
download | urlopener-cb2f99ea8be471546fcefbb09defffab6221e902.tar.gz urlopener-cb2f99ea8be471546fcefbb09defffab6221e902.zip |
add env var for media role and use execve
-rw-r--r-- | urlopen.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -15,6 +15,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#define _POSIX_C_SOURCE 200112L + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -238,6 +240,7 @@ forkexecute(char *url) pid_t pid = fork(); if (pid == 0) { + extern char** environ; /* child process, we don't want to ignore signals */ signal(SIGCHLD, SIG_DFL); /* @@ -269,7 +272,8 @@ forkexecute(char *url) } args[z] = url; args[z+1] = (char *)0; - execvp(args[0], args); + setenv("PULSE_PROP", "media.role=browser", 1); + execve(args[0], args, environ); _exit(1); } else if (pid == -1) |