summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-05-24 15:51:51 +0200
committerJim Meyering <meyering@redhat.com>2011-05-25 16:47:33 +0200
commit0649fbf212224f757245263e5f3c90e423b21571 (patch)
tree6dd7f8f8a5dea13df2fead285a78118dacd6c4ce
parent209af7ee4b7d28a25b0fb33c7e017277291cfc2c (diff)
downloadpatch-0649fbf212224f757245263e5f3c90e423b21571.tar.gz
emit one more diagnostic with the required "program_name: " prefix
* src/util.c: Include "error.h". (ask): Use error, not perror. The latter would not have included the usual "program name: " prefix.
-rw-r--r--src/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c
index eed869d..89a3f49 100644
--- a/src/util.c
+++ b/src/util.c
@@ -30,6 +30,7 @@
#include <getdate.h>
#include "ignore-value.h"
+#include "error.h"
#include <signal.h>
#if !defined SIGCHLD && defined SIGCLD
@@ -1006,8 +1007,7 @@ ask (char const *format, ...)
printf ("EOF\n");
else if (r < 0)
{
- perror ("tty read");
- fflush (stderr);
+ error (0, errno, "tty read failed");
ignore_value (close (ttyfd));
ttyfd = -1;
r = 0;