From e7dd7209b8b3c7fcf0a2ca681470d33a9cb09267 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 17 Jun 2007 12:21:59 +0200 Subject: inotail.c: emalloc should return void * Also add the unlikely() to the check of the malloc retval. This patch seems to have gotten lost during a merge. --- inotail.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inotail.c b/inotail.c index 3643c13..a9282c5 100644 --- a/inotail.c +++ b/inotail.c @@ -63,11 +63,11 @@ static const struct option long_opts[] = { { NULL, 0, NULL, 0 } }; -static char *emalloc(size_t size) +static void *emalloc(size_t size) { - char *ret = malloc(size); + void *ret = malloc(size); - if (!ret) { + if (unlikely(!ret)) { fprintf(stderr, "Error: Failed to allocate %d bytes of memory (%s)\n", size, strerror(errno)); exit(EXIT_FAILURE); } -- cgit v1.2.3-54-g00ecf