From 998546559e67e8922f70c2ec4be240912a0a37aa Mon Sep 17 00:00:00 2001 From: Norihiro Tanaka Date: Sat, 20 Dec 2014 14:01:50 +0900 Subject: [PATCH] chdir-long: avoid -Werror=unused-variable with -DNDEBUG * lib/chdir-long.c: Avoid declaration of close_fail, if defined NDEBUG. --- lib/chdir-long.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/chdir-long.c b/lib/chdir-long.c index 5b1b18f..01be65e 100644 --- a/lib/chdir-long.c +++ b/lib/chdir-long.c @@ -59,8 +59,12 @@ cdb_free (struct cd_buf const *cdb) { if (0 <= cdb->fd) { +#if NDEBUG + close (cdb->fd); +#else bool close_fail = close (cdb->fd); assert (! close_fail); +#endif } } -- 2.2.0