src/lib/watchdog.c
int start_watchdog(void)
{
   int stat;
   watchdog_t *dummy = NULL;
   int errstat;

   if (wd_is_init) {
      return 0;
   }
   Dmsg0(800, "Initialising NicB-hacked watchdog thread\n");
   watchdog_time = time(NULL);

   if ((errstat=rwl_init(&lock)) != 0) {
      berrno be;
      Jmsg1(NULL, M_ABORT, 0, _("Unable to initialize watchdog lock. ERR=%s\n"),
            be.bstrerror(errstat));
   }
   wd_queue = New(dlist(dummy, &dummy->link));
   wd_inactive = New(dlist(dummy, &dummy->link));
   wd_is_init = true;

   if ((stat = pthread_create(&wd_tid, NULL, watchdog_thread, NULL)) != 0) {
      return stat;
   }
   return 0;
}
/*
 * Start watchdog thread
 *
 *  Returns: 0 on success
 *           errno on failure
 */
Start watchdog thread
Returns: 0 on success
errno on failure
Start watchdog thread Returns : 0 on success errno on failure
int start_watchdog(void)
{
   int stat;
   watchdog_t *dummy = NULL;
   int errstat;
   if (wd_is_init) {
      return 0;
   }
   Dmsg0(800, "Initialising NicB-hacked watchdog thread\n");
   watchdog_time = time(NULL);
   if ((errstat=rwl_init(&lock)) != 0) {
      berrno be;
      Jmsg1(NULL, M_ABORT, 0, _("Unable to initialize watchdog lock. ERR=%s\n"),
            be.bstrerror(errstat));
   }
   wd_queue = New(dlist(dummy, &dummy->link));
   wd_inactive = New(dlist(dummy, &dummy->link));
   wd_is_init = true;
   if ((stat = pthread_create(&wd_tid, NULL, watchdog_thread, NULL)) != 0) {
      return stat;
   }
   return 0;
}
int start_watchdog ( void ) { int stat ; watchdog_t * dummy = NULL ; int errstat ; if ( wd_is_init ) { return 0 ; } Dmsg0 ( 800 , " \n " ) ; watchdog_time = time ( NULL ) ; if ( ( errstat = rwl_init ( & lock ) ) != 0 ) { berrno be ; Jmsg1 ( NULL , M_ABORT , 0 , _ ( " \n " ) , be . bstrerror ( errstat ) ) ; } wd_queue = New ( dlist ( dummy , & dummy -> link ) ) ; wd_inactive = New ( dlist ( dummy , & dummy -> link ) ) ; wd_is_init = true ; if ( ( stat = pthread_create ( & wd_tid , NULL , watchdog_thread , NULL ) ) != 0 ) { return stat ; } return 0 ; }
Start watchdog thread
  Returns: 0 on success
           errno on failure
Start watchdog thread Returns : 0 on success errno on failure