PND missing output


Pickle

Mega GP Mania
Joined
May 30, 2006
Messages
5,527
Location
Detroit, Michigan
Website
Visit site
Ive noticed this for a while and no idea why it is this way. Maybe its a bug in the system.

When i use my launcher and I open the pnd log of the output in /tmp Im always missing the output from the launcher. I do get the output from the target app, but nothing from the launcher, except when i close the launcher.

Any ideas?
 
This is all im doing:

Code:
void CBase::Log( const char* output, ... )
{
    va_list fmtargs;
    char buffer[1024];

    va_start( fmtargs, output );
    vsnprintf( buffer, sizeof(buffer)-1, output, fmtargs );
    va_end( fmtargs );

    fprintf( stdout, "%s", buffer );
 
 
Yeah, that looks to me like a buffering problem to me. Stdout is a buffered file pipe, though it should get flushed if it contains an endl at the end of it, according to this query. Still, usually safer to flush explicitly rather than rely on messages being correctly formatted.
 
Back
Top