shithub: zuke

Download patch

ref: de1a93144f88ef3675a036739e05371dcf7ff0a6
parent: d11f54fccdac48571f515ac4258afb5ecd76517a
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Nov 24 06:33:08 EST 2020

open /dev/audio with OCEXEC as should have been long time ago

--- a/theme.c
+++ b/theme.c
@@ -34,7 +34,6 @@
 	p = x;
 	dup(*p, 0); dup(*p, 1); close(*p);
 	close(p[1]);
-	close(p[2]);
 	dup(f = open("/dev/null", OWRITE), 2); close(f);
 	execl("/bin/picker", "picker", nil);
 
@@ -42,16 +41,15 @@
 }
 
 static void
-themeproc(void *audio)
+themeproc(void *)
 {
 	Biobuf *b;
 	char *s, *v[3];
-	int p[3], n, i;
+	int p[2], n, i;
 	static int pid;
 
 	threadsetname("themeproc");
 	pipe(p);
-	p[2] = *(int*)audio;
 	postnote(PNGROUP, pid, "interrupt");
 	pid = threadpid(procrfork(runpicker, p, 4096, RFFDG|RFNAMEG|RFNOTEG));
 	close(p[0]);
--- a/zuke.c
+++ b/zuke.c
@@ -84,7 +84,7 @@
 audioon(void)
 {
 	qlock(&audiolock);
-	if(audio < 0 && (audio = open("/dev/audio", OWRITE)) < 0 && audioerr == 0){
+	if(audio < 0 && (audio = open("/dev/audio", OWRITE|OCEXEC)) < 0 && audioerr == 0){
 		fprint(2, "%r\n");
 		audioerr = 1;
 	}
@@ -1054,7 +1054,7 @@
 			if(m.buttons == 4){
 				n = menuhit(3, mctl, &menu3, nil);
 				if(n == 0)
-					themetid = proccreate(themeproc, &audio, 4096);
+					themetid = proccreate(themeproc, nil, 4096);
 				else if(n == 1)
 					goto end;
 				goto ev;