mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-06 16:49:51 +08:00
dsm: only close valid fds
This commit is contained in:
+4
-1
@@ -308,7 +308,10 @@ dsm_init(const char *device)
|
||||
void
|
||||
dsm_deinit()
|
||||
{
|
||||
close(dsm_fd);
|
||||
if (dsm_fd >= 0) {
|
||||
close(dsm_fd);
|
||||
}
|
||||
|
||||
dsm_fd = -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user