summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jones <admin@danieljon.es>2019-12-01 15:48:26 +1030
committerDaniel Jones <admin@danieljon.es>2019-12-01 15:48:26 +1030
commitcb2f99ea8be471546fcefbb09defffab6221e902 (patch)
treee2875cdd0d3e63b8246ef6472e4aee623ffeccc3
parentcea6e51199c9748de48f37e82fd9b8b863dc55fc (diff)
downloadurlopener-cb2f99ea8be471546fcefbb09defffab6221e902.tar.gz
urlopener-cb2f99ea8be471546fcefbb09defffab6221e902.zip
add env var for media role and use execve
-rw-r--r--urlopen.c6
1 files changed, 5 insertions, 1 deletions
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 <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)