]> sigrok.org Git - libsigrok.git/blobdiff - src/input/input.c
portability: Use g_strerror() in favor of strerror().
[libsigrok.git] / src / input / input.c
index 2b5e3afbd8bae0f26018cd0a42cadc857fad0287..71604658809761444892d92cf625df2591408006 100644 (file)
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
-#include "libsigrok.h"
+#include <libsigrok/libsigrok.h>
 #include "libsigrok-internal.h"
 
+/** @cond PRIVATE */
 #define LOG_PREFIX "input"
+/** @endcond */
 
 /**
  * @file
@@ -231,7 +233,7 @@ SR_API void sr_input_options_free(const struct sr_option **options)
  *
  * @param imod The input module to use. Must not be NULL.
  * @param options GHashTable consisting of keys corresponding with
- * the module options \c id field. The values should be GVariant
+ * the module options @c id field. The values should be GVariant
  * pointers with sunk references, of the same GVariantType as the option's
  * default value.
  *
@@ -429,7 +431,7 @@ SR_API int sr_input_scan_file(const char *filename, const struct sr_input **in)
        }
 
        if (stat(filename, &st) < 0) {
-               sr_err("%s", strerror(errno));
+               sr_err("%s", g_strerror(errno));
                return SR_ERR_ARG;
        }
 
@@ -469,7 +471,7 @@ SR_API int sr_input_scan_file(const char *filename, const struct sr_input **in)
                                                GINT_TO_POINTER(st.st_size));
                        } else if (mitem == SR_INPUT_META_HEADER) {
                                if ((fd = open(filename, O_RDONLY)) < 0) {
-                                       sr_err("%s", strerror(errno));
+                                       sr_err("%s", g_strerror(errno));
                                        return SR_ERR;
                                }
                                size = read(fd, header_buf->str, 128);
@@ -477,7 +479,7 @@ SR_API int sr_input_scan_file(const char *filename, const struct sr_input **in)
                                close(fd);
                                if (size <= 0) {
                                        g_string_free(header_buf, TRUE);
-                                       sr_err("%s", strerror(errno));
+                                       sr_err("%s", g_strerror(errno));
                                        return SR_ERR;
                                }
                                g_hash_table_insert(meta, GINT_TO_POINTER(mitem), header_buf);
@@ -588,5 +590,4 @@ SR_API void sr_input_free(const struct sr_input *in)
        g_free((gpointer)in);
 }
 
-
 /** @} */