X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fcommon.h;h=cf4c5a71b9ac484a52be4cb2b6975434afd6922e;hb=a9e50e9e30ecde17e167e271060c8183bfcbf407;hp=7f8605215b7f5de425721bba2e8a482b352ee5ce;hpb=c84ce4c2d974d891712f0287932f57ed7e6be98d;p=collectd.git diff --git a/src/daemon/common.h b/src/daemon/common.h index 7f860521..cf4c5a71 100644 --- 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