From fe75aa51cd8c5acfa66d9506e5acc44f5630b753 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 9 Dec 2014 04:16:41 +0100 Subject: make exit_if easier on the syntax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsserver/macros.h | 2 +- src/mds-base.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libmdsserver/macros.h b/src/libmdsserver/macros.h index 5329298..10ae2af 100644 --- a/src/libmdsserver/macros.h +++ b/src/libmdsserver/macros.h @@ -400,7 +400,7 @@ * @param condition The condition * @param instructions The instruction (semicolon-terminated) */ -#define exit_if(condition, instructions) if (condition) do { instructions return 1; } while (0) +#define exit_if(condition, instructions) do { if (condition) { instructions return 1; } } while (0) /** diff --git a/src/mds-base.c b/src/mds-base.c index 85f0ef7..9b2db1a 100644 --- a/src/mds-base.c +++ b/src/mds-base.c @@ -156,11 +156,9 @@ int __attribute__((weak)) parse_cmdline(void) /* Check that mandatory arguments have been specified. */ if (server_characteristics.require_respawn_info) - { - exit_if (is_respawn < 0, - eprintf("missing state argument, require either %s or %s.", - "--initial-spawn", "--respawn");); - } + exit_if (is_respawn < 0, + eprintf("missing state argument, require either %s or %s.", + "--initial-spawn", "--respawn");); return 0; } -- cgit v1.2.3-70-g09d2