From cb2f99ea8be471546fcefbb09defffab6221e902 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Sun, 1 Dec 2019 15:48:26 +1030 Subject: add env var for media role and use execve --- urlopen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/urlopen.c b/urlopen.c index 814aa99..20aa4d3 100644 --- a/urlopen.c +++ b/urlopen.c @@ -15,6 +15,8 @@ * along with this program. If not, see . */ +#define _POSIX_C_SOURCE 200112L + #include #include #include @@ -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) -- cgit v1.2.3