Close connection number to display in fork child
This commit is contained in:
parent
f73a8d5b2c
commit
d97732daf9
|
@ -50,6 +50,7 @@ buttonhandler(int signal, siginfo_t *si, void *ucontext)
|
||||||
perror("buttonhandler - fork");
|
perror("buttonhandler - fork");
|
||||||
exit(1);
|
exit(1);
|
||||||
case 0:
|
case 0:
|
||||||
|
close(ConnectionNumber(dpy));
|
||||||
for (Block *current = blocks; current->pathu; current++) {
|
for (Block *current = blocks; current->pathu; current++) {
|
||||||
if (current->signal == signal) {
|
if (current->signal == signal) {
|
||||||
char button[] = { '0' + (si->si_value.sival_int & 0xff), '\0' };
|
char button[] = { '0' + (si->si_value.sival_int & 0xff), '\0' };
|
||||||
|
@ -79,6 +80,7 @@ getcmd(Block *block, int *sigval)
|
||||||
perror("getcmd - fork");
|
perror("getcmd - fork");
|
||||||
exit(1);
|
exit(1);
|
||||||
case 0:
|
case 0:
|
||||||
|
close(ConnectionNumber(dpy));
|
||||||
close(fd[0]);
|
close(fd[0]);
|
||||||
if (dup2(fd[1], STDOUT_FILENO) != STDOUT_FILENO) {
|
if (dup2(fd[1], STDOUT_FILENO) != STDOUT_FILENO) {
|
||||||
perror("getcmd - dup2");
|
perror("getcmd - dup2");
|
||||||
|
|
Loading…
Reference in a new issue