projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
531bad3
)
daemon/common.h: Add the STRERROR() and STRERRNO macros.
author
Florian Forster
<octo@collectd.org>
Sat, 4 Nov 2017 18:28:34 +0000
(19:28 +0100)
committer
Florian Forster
<octo@collectd.org>
Sat, 4 Nov 2017 18:49:24 +0000
(19:49 +0100)
src/daemon/common.h
patch
|
blob
|
history
diff --git
a/src/daemon/common.h
b/src/daemon/common.h
index
7f86052
..
cf4c5a7
100644
(file)
--- a/
src/daemon/common.h
+++ b/
src/daemon/common.h
@@
-73,6
+73,13
@@
char *sstrdup(const char *s);
void *smalloc(size_t size);
char *sstrerror(int errnum, char *buf, size_t buflen);
+#ifndef ERRBUF_SIZE
+#define ERRBUF_SIZE 256
+#endif
+
+#define STRERROR(e) sstrerror((e), (char[ERRBUF_SIZE]){0}, ERRBUF_SIZE)
+#define STRERRNO STRERROR(errno)
+
/*
* NAME
* sread