X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Ffiled%2Fheartbeat.c;h=26ca962bc63ae58833e961cf52cc1fd1821d3e9e;hb=25f607f9bd00610e4cf7b72dd1808cbb23fc3632;hp=d50eec17ea86201148c60c4e7ba297c0fa325b4d;hpb=217e5ed47147cd420ed0799a96868a561bfd6b57;p=bacula%2Fbacula diff --git a/bacula/src/filed/heartbeat.c b/bacula/src/filed/heartbeat.c index d50eec17ea..26ca962bc6 100644 --- a/bacula/src/filed/heartbeat.c +++ b/bacula/src/filed/heartbeat.c @@ -6,7 +6,7 @@ The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. This program is Free Software; you can redistribute it and/or - modify it under the terms of version two of the GNU General Public + modify it under the terms of version three of the GNU Affero General Public License as published by the Free Software Foundation and included in the file LICENSE. @@ -15,7 +15,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Affero General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -139,9 +139,11 @@ void stop_heartbeat_monitor(JCR *jcr) jcr->hb_dir_bsock->set_timed_out(); /* set timed_out to terminate read */ jcr->hb_dir_bsock->set_terminated(); /* set to terminate read */ } - Dmsg0(100, "Send kill to heartbeat id\n"); - pthread_kill(jcr->heartbeat_id, TIMEOUT_SIGNAL); /* make heartbeat thread go away */ - bmicrosleep(0, 50000); + if (jcr->hb_started) { + Dmsg0(100, "Send kill to heartbeat id\n"); + pthread_kill(jcr->heartbeat_id, TIMEOUT_SIGNAL); /* make heartbeat thread go away */ + bmicrosleep(0, 50000); + } cnt = 0; /* Wait max 100 secs for heartbeat thread to stop */ while (jcr->hb_started && cnt++ < 200) {