Re: problem in usage of grub_errno...

2005-12-19 Thread Vesa Jääskeläinen
Tomáš Ebenlendr wrote: >> Error stack is statically allocated and it is protected so that it >> cannot overflow. Error stack is defined as being static to file >> kern/err.c so there is no direct access possible to error stack. >> >> Error stack is emptied in grub_print_error function. (And this is

Re: problem in usage of grub_errno...

2005-12-19 Thread Vesa Jääskeläinen
Joel Buckley wrote: > There is a second bug though... > > A possible stack memory-leak is possible. Replace the > first line with the following to avoid the memory leak: > >if (grub_errno != GRUB_ERR_NONE) { > grub_error_push(); >} > > Otherwise, a useless push is done. Then you

Re: problem in usage of grub_errno...

2005-12-19 Thread Tomáš Ebenlendr
> Error stack is statically allocated and it is protected so that it > cannot overflow. Error stack is defined as being static to file > kern/err.c so there is no direct access possible to error stack. > > Error stack is emptied in grub_print_error function. (And this is called > before prompt is p

Re: problem in usage of grub_errno...

2005-12-18 Thread Joel Buckley
There is a second bug though... A possible stack memory-leak is possible. Replace the first line with the following to avoid the memory leak: if (grub_errno != GRUB_ERR_NONE) { grub_error_push(); } Otherwise, a useless push is done. leoJ. Vesa Jääskeläinen wrote: Tomáš Ebenlen

Re: problem in usage of grub_errno...

2005-12-17 Thread Vesa Jääskeläinen
Tomáš Ebenlendr wrote: > I think there is a 'bug' in the example. Or maybe I'm missing something. Nope, it was intentional. :) > On 17 Prosinec 2005, 18:40, Vesa Jääskeläinen napsal(a): > >> --- >> /* Save possible old error message. */ >> grub_error_push (); >> >> /* Do your stuff here. *

Re: problem in usage of grub_errno...

2005-12-17 Thread Tomáš Ebenlendr
I think there is a 'bug' in the example. Or maybe I'm missing something. On 17 Prosinec 2005, 18:40, Vesa Jääskeläinen napsal(a): > --- > /* Save possible old error message. */ > grub_error_push (); > > /* Do your stuff here. */ > call_possibly_failing_function (); > > if (grub_errno != GRU

Re: problem in usage of grub_errno...

2005-12-17 Thread Vesa Jääskeläinen
I made a test implementation of the proposal. I also made some tests with video subsystem and it eliminated problem I was having. In case there is a similar case that I had, so it is necessary to reset error state but not to discard the actual error message here is some idea how it should be used:

Re: problem in usage of grub_errno...

2005-12-10 Thread Vesa Jääskeläinen
Yoshinori K. Okuji wrote: > On Saturday 10 December 2005 11:05 am, Vesa Jääskeläinen wrote: >> Changing coding guide of using grub_errno we could probably get this >> issue "working". But then there is still problem with lost error >> messages if subsequent code fails with real error. >> >> If we j

Re: problem in usage of grub_errno...

2005-12-10 Thread Yoshinori K. Okuji
On Saturday 10 December 2005 11:05 am, Vesa Jääskeläinen wrote: > Changing coding guide of using grub_errno we could probably get this > issue "working". But then there is still problem with lost error > messages if subsequent code fails with real error. > > If we just zero out grub_errno in code b

Re: problem in usage of grub_errno...

2005-12-10 Thread Vesa Jääskeläinen
Marco Gerards wrote: > Vesa Jääskeläinen <[EMAIL PROTECTED]> writes: > >> Some folks might have overlooked my earlier post as I wrote it to video >> subsystem thread. As this problem needs some kind of resolution and it >> affects larger area of code than just video subsystem it needs to be >> dis

Re: problem in usage of grub_errno...

2005-12-09 Thread Marco Gerards
Vesa Jääskeläinen <[EMAIL PROTECTED]> writes: > Some folks might have overlooked my earlier post as I wrote it to video > subsystem thread. As this problem needs some kind of resolution and it > affects larger area of code than just video subsystem it needs to be > discussed first. > > Problem is