Skip to content

Commit

Permalink
common/JackControlAPI.cpp: -1 is the invalid value for file descripto…
Browse files Browse the repository at this point in the history
…r, not 0.

Kudos to @imaami
  • Loading branch information
nedko committed Nov 5, 2023
1 parent ee831d0 commit cedeffc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/JackControlAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ SERVER_EXPORT void jackctl_finish_signals(jackctl_sigmask_t * signals)
{
#ifdef __linux__
for(int i = 0; i < JackFDCount; i++) {
if(g_signals.pfd[i].fd != 0) {
if(g_signals.pfd[i].fd != -1) {
close(g_signals.pfd[i].fd);
}
}
Expand Down Expand Up @@ -723,7 +723,7 @@ jackctl_setup_signals(
}
}

memset(g_signals.pfd, 0, sizeof(g_signals.pfd));
memset(g_signals.pfd, -1, sizeof(g_signals.pfd));

/* Block the signals in order for signalfd to receive them */
sigprocmask(SIG_BLOCK, &g_signals.signals, NULL);
Expand Down

0 comments on commit cedeffc

Please sign in to comment.