From a2ef611a30b02857dfe727ef06b17aa74d5e181f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 21 Jul 2017 14:22:28 +0200 Subject: [PATCH] dataman: improve error reporting --- src/modules/dataman/dataman.cpp | 2 +- src/modules/mavlink/mavlink_mission.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/dataman/dataman.cpp b/src/modules/dataman/dataman.cpp index 899deba8d5..daca663cd6 100644 --- a/src/modules/dataman/dataman.cpp +++ b/src/modules/dataman/dataman.cpp @@ -637,7 +637,7 @@ _file_read(dm_item_t item, unsigned index, void *buf, size_t count) /* Check for read error */ if (len < 0) { - return -1; + return -errno; } /* A zero length entry is a empty entry */ diff --git a/src/modules/mavlink/mavlink_mission.cpp b/src/modules/mavlink/mavlink_mission.cpp index 9b3ec703b3..7d9562a70a 100644 --- a/src/modules/mavlink/mavlink_mission.cpp +++ b/src/modules/mavlink/mavlink_mission.cpp @@ -120,7 +120,7 @@ MavlinkMissionManager::init_offboard_mission() _current_seq = mission_state.current_seq; } else if (ret < 0) { - PX4_ERR("offboard mission init failed (%i)", errno); + PX4_ERR("offboard mission init failed (%i)", ret); } load_geofence_stats();