diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-22 11:25:25 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-22 22:20:28 -0400 |
commit | 2d88d8779fb5cbc0e466d22a75ef5e3e6877065e (patch) | |
tree | 313bccfca68cdf9212c763dfd86c09e5f51087f2 /include | |
parent | d67a74e55ac8d2e34dca025ce97795886a9da44b (diff) | |
download | stasis-2d88d8779fb5cbc0e466d22a75ef5e3e6877065e.tar.gz |
Make SYSERROR macro act more like perror, and allow extra arguments
Diffstat (limited to 'include')
-rw-r--r-- | include/omc.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/omc.h b/include/omc.h index 0b1c562..e693834 100644 --- a/include/omc.h +++ b/include/omc.h @@ -10,7 +10,10 @@ #include <time.h> #include <sys/statvfs.h> -#define SYSERROR stderr, "%s:%s:%d: %s\n", path_basename(__FILE__), __FUNCTION__, __LINE__, strerror(errno) +#define SYSERROR(MSG, ...) do { \ + fprintf(stderr, "%s:%s:%d:%s - ", path_basename(__FILE__), __FUNCTION__, __LINE__, strerror(errno) ? "info" : strerror(errno)); \ + fprintf(stderr, MSG LINE_SEP, __VA_ARGS__); \ +} while (0) #define OMC_BUFSIZ 8192 #define OMC_NAME_MAX 255 #define OMC_DIRSTACK_MAX 1024 |