Changeset 25437

Show
Ignore:
Timestamp:
05/10/08 17:21:52 (5 days ago)
Author:
bonefish
Message:
Changed FATAL macro to always dprintf() the error. Additionally it still
prints to stdout, but only until the program and its dependencies are
loaded. Failed attempts to load add-ons and the like doesn't pollute
stdout anymore.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • haiku/trunk/src/system/runtime_loader/elf.cpp

    r25213 r25437  
    8383static image_t *sProgramImage; 
    8484static KMessage sErrorMessage; 
     85static bool sProgramLoaded = false; 
    8586 
    8687// a recursive lock 
     
    8990static int32 rld_sem_count; 
    9091 
    91  
    92 #ifdef TRACE_RLD 
    93 #       define FATAL(x...) dprintf("runtime_loader: " x); 
    9492 
    9593void 
     
    106104        va_end(list); 
    107105} 
    108 #else 
    109 #       define FATAL(x...) printf("runtime_loader: " x); 
    110 #endif 
     106 
     107#define FATAL(x...)                                                     \ 
     108        do {                                                                    \ 
     109                dprintf("runtime_loader: " x);          \ 
     110                if (!sProgramLoaded)                            \ 
     111                        printf("runtime_loader: " x);   \ 
     112        } while (false) 
    111113 
    112114 
     
    16081610        rld_unlock(); 
    16091611 
     1612        sProgramLoaded = true; 
     1613 
    16101614        KTRACE("rld: load_program(\"%s\") done: entry: %p, id: %ld", path, 
    16111615                *_entry, sProgramImage->id);