util: handle or ignore SIGPIPE signal

In chronyc handle SIGPIPE similarly to SIGTERM. In chronyd ignore the
signal to avoid crashing when a TCP socket will be needed (e.g. for
NTS-KE) and will be unexpectedly closed from the other side.
This commit is contained in:
Miroslav Lichvar
2018-08-01 12:20:17 +02:00
parent 5bb2bf9361
commit 879d936277
5 changed files with 11 additions and 5 deletions

2
util.h
View File

@@ -161,7 +161,7 @@ extern Float UTI_FloatHostToNetwork(double x);
/* Set FD_CLOEXEC on descriptor */
extern int UTI_FdSetCloexec(int fd);
extern void UTI_SetQuitSignalsHandler(void (*handler)(int));
extern void UTI_SetQuitSignalsHandler(void (*handler)(int), int ignore_sigpipe);
/* Get directory (as an allocated string) for a path */
extern char *UTI_PathToDir(const char *path);