Skip to content

Commit

Permalink
Fix mavutil.mavtcpin not closing the accept()ed port on close() and a…
Browse files Browse the repository at this point in the history
… docstring typo
  • Loading branch information
maranov authored and tridge committed Dec 28, 2022
1 parent 3d5942e commit 8fa1865
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mavutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ def disable_signing(self):
self.mav.signing.timestamp = 0

def set_close_on_exec(fd):
'''set the clone on exec flag on a file descriptor. Ignore exceptions'''
'''set the close on exec flag on a file descriptor. Ignore exceptions'''
try:
import fcntl
flags = fcntl.fcntl(fd, fcntl.F_GETFD)
Expand Down Expand Up @@ -1321,6 +1321,8 @@ def __init__(self, device, source_system=255, source_component=0, retries=3, use
self.port = None

def close(self):
if self.port is not None:
self.port.close()
self.listen.close()

def recv(self,n=None):
Expand Down

0 comments on commit 8fa1865

Please # to comment.