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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25437 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -82,6 +82,7 @@ static image_queue_t sDisposableImages = {0, 0};
|
|||||||
static uint32 sLoadedImageCount = 0;
|
static uint32 sLoadedImageCount = 0;
|
||||||
static image_t *sProgramImage;
|
static image_t *sProgramImage;
|
||||||
static KMessage sErrorMessage;
|
static KMessage sErrorMessage;
|
||||||
|
static bool sProgramLoaded = false;
|
||||||
|
|
||||||
// a recursive lock
|
// a recursive lock
|
||||||
static sem_id rld_sem;
|
static sem_id rld_sem;
|
||||||
@@ -89,9 +90,6 @@ static thread_id rld_sem_owner;
|
|||||||
static int32 rld_sem_count;
|
static int32 rld_sem_count;
|
||||||
|
|
||||||
|
|
||||||
#ifdef TRACE_RLD
|
|
||||||
# define FATAL(x...) dprintf("runtime_loader: " x);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
dprintf(const char *format, ...)
|
dprintf(const char *format, ...)
|
||||||
{
|
{
|
||||||
@@ -105,9 +103,13 @@ dprintf(const char *format, ...)
|
|||||||
|
|
||||||
va_end(list);
|
va_end(list);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
# define FATAL(x...) printf("runtime_loader: " x);
|
#define FATAL(x...) \
|
||||||
#endif
|
do { \
|
||||||
|
dprintf("runtime_loader: " x); \
|
||||||
|
if (!sProgramLoaded) \
|
||||||
|
printf("runtime_loader: " x); \
|
||||||
|
} while (false)
|
||||||
|
|
||||||
|
|
||||||
/*! Mini atoi(), so we don't have to include the libroot dependencies.
|
/*! Mini atoi(), so we don't have to include the libroot dependencies.
|
||||||
@@ -1607,6 +1609,8 @@ load_program(char const *path, void **_entry)
|
|||||||
|
|
||||||
rld_unlock();
|
rld_unlock();
|
||||||
|
|
||||||
|
sProgramLoaded = true;
|
||||||
|
|
||||||
KTRACE("rld: load_program(\"%s\") done: entry: %p, id: %ld", path,
|
KTRACE("rld: load_program(\"%s\") done: entry: %p, id: %ld", path,
|
||||||
*_entry, sProgramImage->id);
|
*_entry, sProgramImage->id);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user