mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 03:53:33 +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