Skip to content

Commit

Permalink
Fix setting SIG_IGN handler for SIGCHLD, SIGPIPE
Browse files Browse the repository at this point in the history
Caught thanks to Ubuntu 24.10 giving compilation error:

ccache gcc -std=c99 -Wall -g3 -ggdb -O3 -isystem /build/source/stage/include -iquote /build/source/lib -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -I /usr/include/opencv4 -pthread -MMD -DV3_LICENSING -I//build/source/server/lexapi -DBC_VERSION='"3.1.8"' -Wdate-time -D_FORTIFY_SOURCE=3  -c -o signals.o signals.c
signals.c: In function 'signals_setup':
signals.c:61:25: error: assignment to 'void (*)(int,  siginfo_t *, void *)' from incompatible pointer type 'void (*)(int)' [-Wincompatible-pointer-types]
   61 |         sa.sa_sigaction = SIG_IGN;
      |                         ^
make[2]: *** [<builtin>: signals.o] Error 1
  • Loading branch information
andrey-utkin committed Dec 12, 2024
1 parent ff6023c commit 4c7694f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ void signals_setup()
}

// these signals are ignored:
sa.sa_sigaction = SIG_IGN;
memset(&sa, 0, sizeof(sa));
sa.sa_flags = SA_NOCLDWAIT;
sa.sa_handler = SIG_IGN;
ret = sigaction(SIGCHLD, &sa, NULL);
assert(!ret);
ret = sigaction(SIGPIPE, &sa, NULL);
Expand Down

0 comments on commit 4c7694f

Please sign in to comment.