I need to handle some signal with sigaction, but when I compile my code I get this error:
warning: assignment from incompatible pointer type
the code is:
struct sigaction hup_act;
...
hup_act.sa_flags=SA_SIGINFO;
hup_act.sa_sigaction = sighupHandler;
sigaction(SIGHUP, &hup_act, NULL);
Warning is on hup_act.sa_sigaction assignment. This warning causes a segmentation fault when I send sighup to my application.
If
SA_SIGINFOis set instruct sigaction‘s membersa_flagsuse a method of typeas handler function to be assigned to
struct sigaction‘s membersa_sigactionelse use a method of type
as handler function to be assigned to
struct sigaction‘s membersa_handler.