diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-14 14:03:57 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-14 14:03:57 +0100 |
commit | c4dc310ebda8f79ec13c68745408444661b32fe1 (patch) | |
tree | dbcff8bb63143a85cba2facc25ac3234a10876a8 /src/modules/commander | |
parent | 47e0c926a6932b7a60ce85a5c748ce5bfcc102e7 (diff) | |
download | px4-firmware-c4dc310ebda8f79ec13c68745408444661b32fe1.tar.gz px4-firmware-c4dc310ebda8f79ec13c68745408444661b32fe1.tar.bz2 px4-firmware-c4dc310ebda8f79ec13c68745408444661b32fe1.zip |
Fixed bogus return value of publication blocking disable
Diffstat (limited to 'src/modules/commander')
-rw-r--r-- | src/modules/commander/state_machine_helper.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp index 44e3aa787..7ae61d9ef 100644 --- a/src/modules/commander/state_machine_helper.cpp +++ b/src/modules/commander/state_machine_helper.cpp @@ -505,12 +505,11 @@ int hil_state_transition(hil_state_t new_state, int status_pub, struct vehicle_s while ((direntry = readdir(d)) != NULL) { - bool blocked = false; int sensfd = ::open(direntry->d_name, 0); - ::ioctl(sensfd, DEVIOCSPUBBLOCK, 0); + int block_ret = ::ioctl(sensfd, DEVIOCSPUBBLOCK, 0); close(sensfd); - printf("Disabling %s\n: %s", direntry->d_name, (blocked) ? "OK" : "FAIL"); + printf("Disabling %s\n: %s", direntry->d_name, (!block_ret) ? "OK" : "FAIL"); } closedir(d); |