From bb2fef06eb52eefe0d72d6e536cd928565dcdcd0 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 24 May 2011 13:29:46 +0200 Subject: explicitly ignore close return value to placate static analyzers * src/util.c: Include "ignore-value.h". (ask): Use ignore_value to tell tools that yes, we really do mean to ignore any close failure on this error path. * bootstrap.conf (gnulib_modules): Add ignore-value. --- bootstrap.conf | 1 + src/util.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bootstrap.conf b/bootstrap.conf index 607ad1a..a460c57 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -34,6 +34,7 @@ gettime gitlog-to-changelog git-version-gen hash +ignore-value lchmod lstat maintainer-makefile diff --git a/src/util.c b/src/util.c index 0fb22d6..1f25c98 100644 --- a/src/util.c +++ b/src/util.c @@ -29,6 +29,7 @@ #include #include +#include "ignore-value.h" #include #if !defined SIGCHLD && defined SIGCLD @@ -1007,7 +1008,7 @@ ask (char const *format, ...) { perror ("tty read"); fflush (stderr); - close (ttyfd); + ignore_value (close (ttyfd)); ttyfd = -1; r = 0; } -- cgit v1.2.1