daemon: Use modern compound literal for SIGPIPE ignore

Signed-off-by: Susant Sahani <ssahani@redhat.com>
This commit is contained in:
Susant Sahani
2025-11-21 18:36:13 +05:30
committed by rwmjones
parent 25485036a6
commit 276897c4df

View File

@@ -166,11 +166,7 @@ main (int argc, char *argv[])
#ifndef WIN32
/* Make sure SIGPIPE doesn't kill us. */
struct sigaction sa;
memset (&sa, 0, sizeof sa);
sa.sa_handler = SIG_IGN;
sa.sa_flags = 0;
if (sigaction (SIGPIPE, &sa, NULL) == -1)
if (sigaction (SIGPIPE, &(struct sigaction){ .sa_handler = SIG_IGN }, NULL) == -1)
perror ("sigaction SIGPIPE"); /* but try to continue anyway ... */
#endif