]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/baylibre-acme/protocol.c
Build: Include <config.h> first in all source files
[libsigrok.git] / src / hardware / baylibre-acme / protocol.c
index 8e730f15d0f26e5933512f86fa7da4cdddc3d4e6..d9131cb09c9f3fe097366b85f3f2b178c2ebe652 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <string.h>
 #include <stdlib.h>
 #include <errno.h>
@@ -380,7 +381,7 @@ SR_PRIV int bl_acme_set_shunt(const struct sr_channel_group *cg, uint64_t shunt)
         */
        fd = g_fopen(path->str, "w");
        if (!fd) {
-               sr_err("Error opening %s: %s", path->str, strerror(errno));
+               sr_err("Error opening %s: %s", path->str, g_strerror(errno));
                ret = SR_ERR_IO;
                goto out;
        }
@@ -507,8 +508,8 @@ static float read_sample(struct sr_channel *ch)
 
        len = read(fd, buf, sizeof(buf));
        if (len < 0) {
-               sr_err("Error reading from channel %s (hwmon: %s): %s",
-                       ch->name, chp->probe->hwmon_num, strerror(errno));
+               sr_err("Error reading from channel %s (hwmon: %d): %s",
+                       ch->name, chp->probe->hwmon_num, g_strerror(errno));
                ch->enabled = FALSE;
                return -1.0;
        }
@@ -540,7 +541,7 @@ SR_PRIV int bl_acme_open_channel(struct sr_channel *ch)
 
        fd = open(path, O_RDONLY);
        if (fd < 0) {
-               sr_err("Error opening %s: %s", path, strerror(errno));
+               sr_err("Error opening %s: %s", path, g_strerror(errno));
                ch->enabled = FALSE;
                return SR_ERR;
        }