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.

RR

Reply via email to