2012/9/26 Colin Watson <cjwat...@ubuntu.com>: > On Tue, Sep 25, 2012 at 12:46:15PM +0800, Michael Chang wrote: >> I agree with you. IMHO the problem is it's not emitted directly from >> gettext module but from common underlying fs level, removing it would >> lead to other message which is fatal be ignored as well. > > That's incorrect; the gettext module is perfectly able to disregard > errors from lower-level methods that it doesn't care about.
I'd say I'm too careless in understanding how grub2 message logging. I see grub_error(...) and think it was logged to screen immediately after that function returns, which is completely wrong. The error message and number are staging in the buffer and it's up to the module to use grub_print_error (...) to flush all pending messages to the screen. Nevertheless you could stack errors with push|pop, which is extremely useful as grub2 could be stacked by modules .. Glad to know one more good and flexible design of grub2. :) Thanks, Michael > >> Another question is : Is there any other good method offered by grub2 >> to check the files existence that we could test before calling >> grub_file_open() in gettext.c ? Anybody has good idea on this ? > > This is the wrong approach; you should try it and then handle errors, > not look-before-you-leap. > > -- > Colin Watson [cjwat...@ubuntu.com] > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel