bug-patch
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-patch] [PATCH] emit one more diagnostic with the required "program_


From: Jim Meyering
Subject: [bug-patch] [PATCH] emit one more diagnostic with the required "program_name: " prefix
Date: Tue, 24 May 2011 15:52:40 +0200

I noticed the lone use of "perror" to diagnose this failure.
Here's a fix:

>From b74c057c3581666773150c53736791d2cdb22137 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 24 May 2011 15:51:51 +0200
Subject: [PATCH] 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.
---
 src/util.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util.c b/src/util.c
index 8b23a3b..ca9f9f0 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;
--
1.7.5.2.585.gfbd48



reply via email to

[Prev in Thread] Current Thread [Next in Thread]