X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fcommon.h;h=cf4c5a71b9ac484a52be4cb2b6975434afd6922e;hb=d4cc32c4dddb01081c49a67d13ab4a737cda0ed0;hp=7f8605215b7f5de425721bba2e8a482b352ee5ce;hpb=c7ce4fda9951172e770fe8d625af34aae74e0023;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