shithub: zuke

Download patch

ref: e11985de50aca2b6a958b336e6ccbf209871325b
parent: e54644aa990b4107b39e572c95feab9cd9be65f1
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Thu Jun 25 09:18:32 EDT 2020

close audio in picker proc since we're forking with RFFDG

--- a/theme.c
+++ b/theme.c
@@ -34,6 +34,7 @@
 	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);
 
@@ -41,14 +42,15 @@
 }
 
 static void
-themeproc(void *)
+themeproc(void *audio)
 {
 	Biobuf *b;
 	char *s, *v[3];
-	int p[2], n, i;
+	int p[3], n, i;
 
 	threadsetname("themeproc");
 	pipe(p);
+	p[2] = *(int*)audio;
 	procrfork(runpicker, p, 4096, RFFDG|RFNAMEG);
 	close(p[0]);
 	b = Bfdopen(p[1], OREAD);
--- a/zuke.c
+++ b/zuke.c
@@ -967,7 +967,7 @@
 			if(m.buttons == 4){
 				n = menuhit(3, mctl, &menu3, nil);
 				if(n == 0)
-					procrfork(themeproc, nil, 4096, RFNOTEG);
+					procrfork(themeproc, &audio, 4096, RFNOTEG);
 				else if(n == 1)
 					goto end;
 				goto ev;