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.
This commit is contained in:
Jim Meyering 2011-05-24 13:29:46 +02:00
parent 6526aec61f
commit bb2fef06eb
2 changed files with 3 additions and 1 deletions

View File

@ -34,6 +34,7 @@ gettime
gitlog-to-changelog
git-version-gen
hash
ignore-value
lchmod
lstat
maintainer-makefile

View File

@ -29,6 +29,7 @@
#include <xalloc.h>
#include <getdate.h>
#include "ignore-value.h"
#include <signal.h>
#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;
}