It it helps, the man page for stderr states that "The stream stderr is
unbuffered."  Thus, fflush() would not be needed here.  Though, I suppose
it's possible that someone is using a strange system where stderr doesn't
follow ANSI specifications.

Cheers,
Steve

> * Eric Brower <[email protected]> [2010-06-24 11:30:18]:
>
>> On Wed, Jun 23, 2010 at 9:15 PM, Balbir Singh
>> <[email protected]> wrote:
>> > On Thu, Jun 24, 2010 at 4:34 AM, Eric Brower <[email protected]>
>> wrote:
>> >> The following trivial patch fixes building the current git repository
>> >> when "--enable-debug" is specified to configure.
>> >>
>> >> Signed-off-by: Eric Brower <[email protected]>
>> >>
>> >
>> > Thanks for catching this Eric, I think this fix is good, but while you
>> > are at it could you please convert the cgroup_dbg() to an
>> > fprint(stderr, "%s", msg), we don't want to be losing fatal errors
>> > because we failed to enable debug
>> >
>> > Balbir
>> >
>>
>> How about the following, then:
>>
>> Companion to prior change-- fix syntax error in YY_FATAL_ERROR
>> preventing compilation when CGROUP_DEBUG is defined, and log internal
>> lex errors regardless of CGROUP_DEBUG.
>>
>> Signed-off-by: Eric Brower <[email protected]>
>>
>> diff --git a/src/lex.l b/src/lex.l
>> index 2f4e313..f2b4e58 100644
>> --- a/src/lex.l
>> +++ b/src/lex.l
>> @@ -18,7 +18,8 @@
>>  #include "parse.h"
>>  int line_no = 1;
>>
>> -#define YY_FATAL_ERROR(msg) cgroup_dbg(%s)
>> +#define YY_FATAL_ERROR(msg) \
>> +       do { fprintf(stderr, "%s\n", msg); fflush(stderr); } while (0)
>>  %}
>>
>
> I wonder if we need an fflush(), but since it is rare, it is better to
> flush the critical message out I suspect.
>
> Acked-by: Balbir Singh <[email protected]>
>
>
> --
>       Three Cheers,
>       Balbir
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Libcg-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libcg-devel
>



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to