From 1e552d3d89bc6658c687849ab59fc62577e9fef3 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 1 Nov 2024 00:50:12 -0400 Subject: Fix SYSERROR macro * "info" was always printed instead of the errno string. Now it prints the error and returns "info" on "Success" --- include/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/core.h b/include/core.h index b0a1a11..b8b047f 100644 --- a/include/core.h +++ b/include/core.h @@ -12,7 +12,7 @@ #include #define SYSERROR(MSG, ...) do { \ - fprintf(stderr, "%s:%s:%d:%s - ", path_basename(__FILE__), __FUNCTION__, __LINE__, strerror(errno) ? "info" : strerror(errno)); \ + fprintf(stderr, "%s:%s:%d:%s - ", path_basename(__FILE__), __FUNCTION__, __LINE__, (errno > 0) ? strerror(errno) : "info"); \ fprintf(stderr, MSG LINE_SEP, __VA_ARGS__); \ } while (0) #define STASIS_BUFSIZ 8192 -- cgit