Am Donnerstag 11 Februar 2010 12:03:17 schrieben Sie:
> Hello Philipp,
> 
> Le Jeudi 11 Février 2010 11:55:40, Philipp Storz a écrit :
> > Sorry, I posted this message to bacula-users by mistake,
> > I wanted it to go to the bacula-devel list......
> >
> > Hello,
> >
> > I tried bacula with the new auto completion feature, and I love it!
> > It is very nice that you also can search in the previous commands like in
> > bash via ctrl-R.
> >
> > When I monitored the status of the storage daemon via skript, which was
> > called a *lot* of times,  I found a problem with it:
> >
> > The size of the file bconsole_history seems not to be limited, like e.g
> > the bash_history file is.
> >
> > This leads to the strange problem that on startup, the bconsole takes a
> > lot of time until it offers a prompt.
> >
> > Is it possible to limit the size of the history file to e.g. 100 or 500
> > lines?
> 
> A bit strange, we are using this instruction, and it should keep the
>  history rather small.
> 
> history_truncate_file(histfile, 100)
> 
> Maybe it doesn't work as expected...
> 
> Bye
> 
> > Best regards,
> >
> > Philipp
> 

Hello Eric,

I tested the call of history_stifle, and it works. 

I do not know, why the history now never grows bigger than 200 lines, while
the parameter I give to history_stifle is 100, but it works.

You find my patch attached.

best regards,

Philipp



-- 
  Philipp Storz                               [email protected]
  dass IT GmbH                                 Phone:  +49.221.3565666-92
  http://www.dass-IT.de/                        Fax  : +49.221.3565666-10

  Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRB52500 
  GF: Stephan Dühr, Maik Außendorf, Jörg Steffens, Philipp Storz
diff --git a/bacula/src/console/console.c b/bacula/src/console/console.c
index c92f9e5..10b9ebc 100644
--- a/bacula/src/console/console.c
+++ b/bacula/src/console/console.c
@@ -873,6 +873,7 @@ static int console_init_history(const char *histfile)
    rl_completion_entry_function = dummy_completion_function;
    rl_attempted_completion_function = readline_completion;
    rl_filename_completion_desired = 0;
+   stifle_history(100);
 #endif

    return ret;

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to