aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/commander/state_machine_helper.cpp5
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);