-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78a7c11
commit 5e79a2a
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,7 +189,9 @@ static int cancellation_fd[] = {-1, -1}; | |
|
||
void sig_handler(int sig) { | ||
run_daemon = 0; | ||
write(cancellation_fd[1], &sig, sizeof sig); | ||
if (-1 == write(cancellation_fd[1], &sig, sizeof sig)) { | ||
fprintf(stderr, "Failed immediate cancellation: %s", strerror(errno)); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
lsteube
|
||
} | ||
} | ||
|
||
static void *cancellation_proc(void *arg) | ||
|
Small nitpick: According to sigaction(2) (and also signal-safety(7) on Linux)
fprintf(3)
is not safe when used in the signal handler and may clobber some stdio buffers.write(2)
is fine. Would casting output fromwrite
to(void)
quell the warning as well?