mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-18 20:57:56 +00:00
Don't unwatch if the file descriptor is already closed
This commit is contained in:
parent
55cad42932
commit
33e44ed6be
@ -982,8 +982,10 @@ static int rhizome_fetch_close(struct rhizome_fetch_slot *slot)
|
|||||||
|
|
||||||
/* close socket and stop watching it */
|
/* close socket and stop watching it */
|
||||||
unschedule(&slot->alarm);
|
unschedule(&slot->alarm);
|
||||||
unwatch(&slot->alarm);
|
if (slot->alarm.poll.fd>=0){
|
||||||
close(slot->alarm.poll.fd);
|
unwatch(&slot->alarm);
|
||||||
|
close(slot->alarm.poll.fd);
|
||||||
|
}
|
||||||
slot->alarm.poll.fd = -1;
|
slot->alarm.poll.fd = -1;
|
||||||
slot->alarm.function=NULL;
|
slot->alarm.function=NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user