Hilko Bengen
2012-Jan-10 22:35 UTC
[Libguestfs] [PATCH] fish: Do not emit error message if history file cannot be open for writing.
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 b782b7c..bf976ea 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -1433,10 +1433,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
Richard W.M. Jones
2012-Jan-11 10:24 UTC
[Libguestfs] [PATCH] fish: Do not emit error message if history file cannot be open for writing.
On Tue, Jan 10, 2012 at 11:35:11PM +0100, Hilko Bengen wrote:> 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 b782b7c..bf976ea 100644 > --- a/fish/fish.c > +++ b/fish/fish.c > @@ -1433,10 +1433,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_HISTORYACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
Possibly Parallel Threads
- [PATCH] fish: Use minimal permissions when initially creating history file
- [PATCH] fish: fix the Ctrl-\ causes guestfish to abort bug(RHBZ#596761)
- Various fixes from building libguestfs for Debian
- [PATCH] fish: reset the console on ^Z RHBZ#1213844
- Re: Trouble with libgsm on Mac OS X 10.6.2