diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-11-22 15:08:54 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-11-22 15:08:54 +0100 |
commit | 6da9063560b900c0ce13bb0e078889eeaf8c71c0 (patch) | |
tree | 8a606daa3887c73aa87544a01f4d60e39a8f69c8 /src | |
parent | 9bb0ecf0ca6082355072af190018e0b5298b7e59 (diff) | |
download | px4-firmware-6da9063560b900c0ce13bb0e078889eeaf8c71c0.tar.gz px4-firmware-6da9063560b900c0ce13bb0e078889eeaf8c71c0.tar.bz2 px4-firmware-6da9063560b900c0ce13bb0e078889eeaf8c71c0.zip |
Fix FD for commander arm operation
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/commander/commander.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index ec173c12b..e081955d0 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -310,12 +310,16 @@ int commander_main(int argc, char *argv[]) } if (!strcmp(argv[1], "arm")) { - arm_disarm(true, mavlink_fd, "command line"); + int mavlink_fd_local = open(MAVLINK_LOG_DEVICE, 0); + arm_disarm(true, mavlink_fd_local, "command line"); + close(mavlink_fd_local); exit(0); } if (!strcmp(argv[1], "disarm")) { - arm_disarm(false, mavlink_fd, "command line"); + int mavlink_fd_local = open(MAVLINK_LOG_DEVICE, 0); + arm_disarm(false, mavlink_fd_local, "command line"); + close(mavlink_fd_local); exit(0); } |