Port: replace strerror_r() with glib g_strerror()
[babeltrace.git] / include / babeltrace / babeltrace-internal.h
index 1a438ded8abf616b627ebb3792e6135cafd3bfd0..006bf8f3c7954618eb10fc9772ed6ce4822a6775 100644 (file)
@@ -86,16 +86,16 @@ extern bt_bool babeltrace_verbose, babeltrace_debug;
 
 #define _bt_printf_perror(fp, fmt, args...)                            \
        ({                                                              \
-               char buf[PERROR_BUFLEN] = "Error in strerror_r()";      \
-               bt_strerror_r(errno, buf, sizeof(buf));         \
-               _bt_printfe(fp, "error", buf, fmt, ## args);            \
+               const char *errstr;                                     \
+               errstr = g_strerror(errno);                             \
+               _bt_printfe(fp, "error", errstr, fmt, ## args);         \
        })
 
 #define _bt_printfl_perror(fp, lineno, fmt, args...)                   \
        ({                                                              \
-               char buf[PERROR_BUFLEN] = "Error in strerror_r()";      \
-               bt_strerror_r(errno, buf, sizeof(buf));         \
-               _bt_printfle(fp, "error", lineno, buf, fmt, ## args);   \
+               const char *errstr;                                     \
+               errstr = g_strerror(errno);                             \
+               _bt_printfle(fp, "error", lineno, errstr, fmt, ## args);\
        })
 
 /* printf without lineno information */
This page took 0.023122 seconds and 4 git commands to generate.