From 38515e5027712d443e3f18cf8525af902372fe8a Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 7 Feb 2011 11:14:52 +0100 Subject: Add __noreturn attribute, update copyright --- inotail.c | 6 ++++-- inotail.h | 15 +++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/inotail.c b/inotail.c index 9d79d01..1dac409 100644 --- a/inotail.c +++ b/inotail.c @@ -3,7 +3,9 @@ * A fast implementation of tail which uses the inotify API present in * recent versions of the Linux kernel. * - * Copyright (C) 2005-2009, Tobias Klauser + * More information on http://distanz.ch/inotail + * + * Copyright (C) 2005-2011, Tobias Klauser * * The idea was taken from turbotail. * @@ -96,7 +98,7 @@ static inline int xargmatch(const char *context, const char *arg) return (strlen(arg) == ctx_len && strncmp(arg, context, ctx_len) == 0); } -static void usage(const int status) +static void __noreturn usage(const int status) { fprintf(stdout, "Usage: %s [OPTION]... [FILE]...\n\n" " --retry keep trying to open a file even if it is not\n" diff --git a/inotail.h b/inotail.h index 3320c3d..e5ad3c3 100644 --- a/inotail.h +++ b/inotail.h @@ -1,7 +1,8 @@ /* - * Copyright (C) 2005-2009, Tobias Klauser + * Copyright (C) 2005-2011, Tobias Klauser * - * Licensed under the terms of the GNU General Public License; version 2 or later. + * This file is licensed under the terms of the GNU General Public License; + * version 2 or later. */ #ifndef _INOTAIL_H @@ -47,11 +48,13 @@ struct file_struct { #define is_digit(c) ((c) >= '0' && (c) <= '9') #ifdef __GNUC__ -# define likely(x) __builtin_expect(!!(x), 1) -# define unlikely(x) __builtin_expect(!!(x), 0) +# define __noreturn __attribute ((noreturn)) +# define likely(x) __builtin_expect(!!(x), 1) +# define unlikely(x) __builtin_expect(!!(x), 0) #else -# define likely(x) (x) -# define unlikely(x) (x) +# define __noreturn +# define likely(x) (x) +# define unlikely(x) (x) #endif /* __GNUC__ */ #ifdef DEBUG -- cgit v1.2.3-54-g00ecf