@@ -537,9 +537,9 @@ static void log_message (const char *fmt, ...)
537
537
#define DEBUG_MESSAGE (fmt , ...)
538
538
#endif
539
539
540
- static int lsapi_activate_user_ini ();
540
+ static int lsapi_activate_user_ini (void );
541
541
542
- static int sapi_lsapi_activate ()
542
+ static int sapi_lsapi_activate (void )
543
543
{
544
544
char * path , * server_name ;
545
545
size_t path_len , server_name_len ;
@@ -677,7 +677,7 @@ static int do_clean_shutdown = 1;
677
677
static int clean_onexit = 1 ;
678
678
679
679
680
- static void lsapi_clean_shutdown ()
680
+ static void lsapi_clean_shutdown (void )
681
681
{
682
682
struct sigaction act ;
683
683
int sa_rc ;
@@ -689,15 +689,31 @@ static void lsapi_clean_shutdown()
689
689
sigemptyset (& act .sa_mask );
690
690
act .sa_flags = 0 ;
691
691
act .sa_handler = lsapi_sigsegv ;
692
- sa_rc = sigaction (SIGINT , & act , NULL );
693
- sa_rc = sigaction (SIGQUIT , & act , NULL );
694
- sa_rc = sigaction (SIGILL , & act , NULL );
695
- sa_rc = sigaction (SIGABRT , & act , NULL );
696
- sa_rc = sigaction (SIGBUS , & act , NULL );
697
- sa_rc = sigaction (SIGSEGV , & act , NULL );
698
- sa_rc = sigaction (SIGTERM , & act , NULL );
699
-
700
- sa_rc = sigaction (SIGPROF , & act , NULL );
692
+ if ((sa_rc = sigaction (SIGINT , & act , NULL )) < 0 ) {
693
+ return ;
694
+ }
695
+ if ((sa_rc = sigaction (SIGQUIT , & act , NULL )) < 0 ) {
696
+ return ;
697
+ }
698
+ if ((sa_rc = sigaction (SIGILL , & act , NULL )) < 0 ) {
699
+ return ;
700
+ }
701
+ if ((sa_rc = sigaction (SIGABRT , & act , NULL )) < 0 ) {
702
+ return ;
703
+ }
704
+ if ((sa_rc = sigaction (SIGBUS , & act , NULL )) < 0 ) {
705
+ return ;
706
+ }
707
+ if ((sa_rc = sigaction (SIGSEGV , & act , NULL )) < 0 ) {
708
+ return ;
709
+ }
710
+ if ((sa_rc = sigaction (SIGTERM , & act , NULL )) < 0 ) {
711
+ return ;
712
+ }
713
+
714
+ if ((sa_rc = sigaction (SIGPROF , & act , NULL )) < 0 ) {
715
+ return ;
716
+ }
701
717
memset (& tmv , 0 , sizeof (struct itimerval ));
702
718
tmv .it_value .tv_sec = 0 ;
703
719
tmv .it_value .tv_usec = 100000 ;
@@ -738,7 +754,6 @@ static void lsapi_atexit(void)
738
754
}
739
755
}
740
756
741
-
742
757
static int lsapi_module_main (int show_source )
743
758
{
744
759
struct sigaction act ;
@@ -751,13 +766,28 @@ static int lsapi_module_main(int show_source)
751
766
sigemptyset (& act .sa_mask );
752
767
act .sa_flags = SA_NODEFER ;
753
768
act .sa_handler = lsapi_sigterm ;
754
- sa_rc = sigaction ( SIGINT , & act , NULL );
755
- sa_rc = sigaction ( SIGQUIT , & act , NULL );
756
- sa_rc = sigaction ( SIGILL , & act , NULL );
757
- sa_rc = sigaction ( SIGABRT , & act , NULL );
758
- sa_rc = sigaction ( SIGBUS , & act , NULL );
759
- sa_rc = sigaction ( SIGSEGV , & act , NULL );
760
- sa_rc = sigaction ( SIGTERM , & act , NULL );
769
+ if ((sa_rc = sigaction ( SIGINT , & act , NULL )) < 0 ) {
770
+ return -1 ;
771
+ }
772
+
773
+ if ((sa_rc = sigaction ( SIGQUIT , & act , NULL )) < 0 ) {
774
+ return -1 ;
775
+ }
776
+ if ((sa_rc = sigaction ( SIGILL , & act , NULL )) < 0 ) {
777
+ return -1 ;
778
+ }
779
+ if ((sa_rc = sigaction ( SIGABRT , & act , NULL )) < 0 ) {
780
+ return -1 ;
781
+ }
782
+ if ((sa_rc = sigaction ( SIGBUS , & act , NULL )) < 0 ) {
783
+ return -1 ;
784
+ }
785
+ if ((sa_rc = sigaction ( SIGSEGV , & act , NULL )) < 0 ) {
786
+ return -1 ;
787
+ }
788
+ if ((sa_rc = sigaction ( SIGTERM , & act , NULL )) < 0 ) {
789
+ return -1 ;
790
+ }
761
791
762
792
clean_onexit = 0 ;
763
793
}
0 commit comments