yaft/util: fix build with g++ and warnings enabled

Origin commit data
------------------
Commit: 9a7e1065c8
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2018-01-15 (Mon, 15 Jan 2018)
This commit is contained in:
Stefan Seyfried
2018-01-15 19:54:51 +01:00
committed by vanhofen
parent 0e91c3bfd9
commit 112a1c4e91

View File

@@ -7,7 +7,7 @@ enum loglevel_t {
FATAL, FATAL,
}; };
void logging(enum loglevel_t loglevel, char *format, ...) void logging(int loglevel, const char *format, ...)
{ {
va_list arg; va_list arg;
static const char *loglevel2str[] = { static const char *loglevel2str[] = {
@@ -110,13 +110,13 @@ void *ecalloc(size_t nmemb, size_t size)
void *erealloc(void *ptr, size_t size) void *erealloc(void *ptr, size_t size)
{ {
void *new; void *p;
errno = 0; errno = 0;
if ((new = realloc(ptr, size)) == NULL) if ((p = realloc(ptr, size)) == NULL)
logging(ERROR, "realloc: %s\n", strerror(errno)); logging(ERROR, "realloc: %s\n", strerror(errno));
return new; return p;
} }
int eselect(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *tv) int eselect(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *tv)