File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -807,7 +807,8 @@ void kill_the_elder(char *datadir) {
807
807
free (pidpath );
808
808
809
809
if (pid > 1 ) {
810
- if (kill (pid , SIGTERM )) {
810
+ int rc = kill (pid , SIGTERM );
811
+ if (rc ) {
811
812
switch (errno ) {
812
813
case EPERM :
813
814
shout ("was not allowed to kill pid=%d\n" , pid );
@@ -816,11 +817,12 @@ void kill_the_elder(char *datadir) {
816
817
shout ("pid=%d not found for killing\n" , pid );
817
818
break ;
818
819
}
820
+ } else {
821
+ debug ("SIGTERM sent to pid=%d\n" , pid );
822
+ debug ("waiting for pid=%d to die\n" , pid );
823
+ waitpid (pid , NULL , 0 );
824
+ debug ("pid=%d died\n" , pid );
819
825
}
820
- debug ("SIGTERM sent to pid=%d\n" , pid );
821
- debug ("waiting for pid=%d to die\n" , pid );
822
- waitpid (pid , NULL , 0 );
823
- debug ("pid=%d died\n" , pid );
824
826
} else {
825
827
debug ("no elder to kill\n" );
826
828
}
You can’t perform that action at this time.
0 commit comments