Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
opensc-notify: respect signal safety
Thanks, Marcin.
5e79a2a#r38486829
  • Loading branch information
frankmorgner committed Apr 23, 2020
1 parent 5e79a2a commit 843779f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/tools/opensc-notify.c
Expand Up @@ -189,9 +189,7 @@ static int cancellation_fd[] = {-1, -1};

void sig_handler(int sig) {
run_daemon = 0;
if (-1 == write(cancellation_fd[1], &sig, sizeof sig)) {
fprintf(stderr, "Failed immediate cancellation: %s", strerror(errno));
}
(void)write(cancellation_fd[1], &sig, sizeof sig);
}

static void *cancellation_proc(void *arg)
Expand Down

0 comments on commit 843779f

Please sign in to comment.