[Libguestfs] [PATCH 1/7] fish: Do not emit error message if history file cannot be open for writing.

Hilko Bengen bengen at hilluzination.de
Fri Jan 20 07:44:41 UTC 2012


The error message generated by perror() is not particularly useful to
the user. Many other command line programs that can keep history
around cope silently if they can't create or write to their history
file.
---
 fish/fish.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/fish/fish.c b/fish/fish.c
index e388832..3bb9501 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -1431,10 +1431,8 @@ cleanup_readline (void)
 
   if (histfile[0] != '\0') {
     fd = open (histfile, O_WRONLY|O_CREAT, 0644);
-    if (fd == -1) {
-      perror (histfile);
+    if (fd == -1)
       return;
-    }
     close (fd);
 
 #ifdef HAVE_APPEND_HISTORY
-- 
1.7.8.3




More information about the Libguestfs mailing list