bug-bash
[Top][All Lists]
Advanced

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

Re: [bash-bug] no local bash_history created or written to if existing (


From: Chet Ramey
Subject: Re: [bash-bug] no local bash_history created or written to if existing (~/.bash_history
Date: Tue, 08 Mar 2011 10:40:55 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

On 3/8/11 10:10 AM, Dr. Werner Fink wrote:
> On Tue, Mar 08, 2011 at 03:07:13PM +0100, Roman Rakus wrote:
>> On 03/08/2011 12:32 PM, Dr. Werner Fink wrote:
>>> Something like the attached patch.
>>>
>> Seems it doesn't work. I have applied your patch, run that bash in
>> gnome-terminal, close the terminal. In gdb I set a break to atexit()
>> and maybe_save_shell_history() functions. Bash receives SIGHUP, I say
>> continue, bash again receives SIGHUP, again continue and bash ends.
>> gdb is saying: Program terminated with signal SIGHUP, Hangup.
>>
>> In man page of atexit:
>> NOTES
>>        Functions registered using atexit() (and on_exit(3)) are not
>> called  if
>>        a process terminates abnormally because of the delivery of a signal.
>>
>> so I guess it won't work.
> 
> I'm aware of this ... but here is what I see:

atexit(3) is not guaranteed to work that way portably.  Its behavior is
portable and standardized only for "normal program termination."

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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