summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-08-01 15:32:27 +0200
committerJim Meyering <meyering@redhat.com>2012-08-01 15:51:54 +0200
commitcdc94fade38f2b745894c7b724512af506dc803c (patch)
treec79a496ba6864d074f635ad650535d49571001a1
parent120927804de8e523ef9cb8ee7f4210967d4cb80e (diff)
downloadpatch-cdc94fade38f2b745894c7b724512af506dc803c.tar.gz
Don't close a negative file descriptor
* src/inp.c (re_input): Don't close FD if it's negative.
-rw-r--r--src/inp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/inp.c b/src/inp.c
index 9cc140f..6387587 100644
--- a/src/inp.c
+++ b/src/inp.c
@@ -61,7 +61,8 @@ re_input (void)
}
}
else {
- close (tifd);
+ if (tifd >= 0)
+ close (tifd);
tifd = -1;
if (tibuf[0])
{