Improved ping thread stopping
This commit is contained in:
parent
b99eb9aa26
commit
ec76c05fa2
@ -40,7 +40,7 @@
|
|||||||
* Global variables
|
* Global variables
|
||||||
*/
|
*/
|
||||||
extern struct taskrec TCFG; /* Task config record */
|
extern struct taskrec TCFG; /* Task config record */
|
||||||
int ping_isocket; /* Ping socket */
|
int ping_isocket = -1; /* Ping socket */
|
||||||
int icmp_errs = 0; /* ICMP error counter */
|
int icmp_errs = 0; /* ICMP error counter */
|
||||||
extern int internet; /* Internet is down */
|
extern int internet; /* Internet is down */
|
||||||
extern int rescan; /* Master rescan flag */
|
extern int rescan; /* Master rescan flag */
|
||||||
@ -456,6 +456,12 @@ void *ping_thread(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Syslog('p', "Ping thread closing socket %d", ping_isocket);
|
||||||
|
if ((rc = close(ping_isocket))) {
|
||||||
|
WriteError("$ping thread error socket close");
|
||||||
|
}
|
||||||
|
ping_isocket = -1;
|
||||||
|
|
||||||
ping_run = FALSE;
|
ping_run = FALSE;
|
||||||
Syslog('+', "Ping thread stopped");
|
Syslog('+', "Ping thread stopped");
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
|
Reference in New Issue
Block a user