More debug output in case of failure.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10952 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -178,8 +178,8 @@ extern const char * const *__libc_argv;
|
|||||||
|
|
||||||
|
|
||||||
// debugging
|
// debugging
|
||||||
//#define DBG(x) x
|
#define DBG(x) x
|
||||||
#define DBG(x)
|
//#define DBG(x)
|
||||||
#define OUT printf
|
#define OUT printf
|
||||||
|
|
||||||
|
|
||||||
@@ -265,6 +265,7 @@ BApplication::operator=(const BApplication &rhs)
|
|||||||
void
|
void
|
||||||
BApplication::InitData(const char *signature, status_t *_error)
|
BApplication::InitData(const char *signature, status_t *_error)
|
||||||
{
|
{
|
||||||
|
DBG(OUT("BApplication::InitData(`%s', %p)\n", signature, _error));
|
||||||
// check whether there exists already an application
|
// check whether there exists already an application
|
||||||
if (be_app)
|
if (be_app)
|
||||||
debugger("2 BApplication objects were created. Only one is allowed.");
|
debugger("2 BApplication objects were created. Only one is allowed.");
|
||||||
@@ -293,8 +294,13 @@ BApplication::InitData(const char *signature, status_t *_error)
|
|||||||
|
|
||||||
// get app executable ref
|
// get app executable ref
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
if (fInitError == B_OK)
|
if (fInitError == B_OK) {
|
||||||
fInitError = BPrivate::get_app_ref(&ref);
|
fInitError = BPrivate::get_app_ref(&ref);
|
||||||
|
if (fInitError != B_OK) {
|
||||||
|
DBG(OUT("BApplication::InitData(): Failed to get app ref: %s\n",
|
||||||
|
strerror(fInitError)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// get the BAppFileInfo and extract the information we need
|
// get the BAppFileInfo and extract the information we need
|
||||||
uint32 appFlags = B_REG_DEFAULT_APP_FLAGS;
|
uint32 appFlags = B_REG_DEFAULT_APP_FLAGS;
|
||||||
@@ -311,6 +317,9 @@ BApplication::InitData(const char *signature, status_t *_error)
|
|||||||
printf("Signature in rsrc doesn't match constructor arg. (%s, %s)\n",
|
printf("Signature in rsrc doesn't match constructor arg. (%s, %s)\n",
|
||||||
signature, appFileSignature);
|
signature, appFileSignature);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
DBG(OUT("BApplication::InitData(): Failed to get info from: "
|
||||||
|
"BAppFileInfo: %s\n", strerror(fInitError)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -351,6 +360,10 @@ BApplication::InitData(const char *signature, status_t *_error)
|
|||||||
if (!isRegistrar) {
|
if (!isRegistrar) {
|
||||||
fInitError = BRoster::Private().AddApplication(signature, &ref,
|
fInitError = BRoster::Private().AddApplication(signature, &ref,
|
||||||
appFlags, team, thread, fMsgPort, true, NULL, &otherTeam);
|
appFlags, team, thread, fMsgPort, true, NULL, &otherTeam);
|
||||||
|
if (fInitError != B_OK) {
|
||||||
|
DBG(OUT("BApplication::InitData(): Failed to add app: %s\n",
|
||||||
|
strerror(fInitError)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (fInitError == B_ALREADY_RUNNING) {
|
if (fInitError == B_ALREADY_RUNNING) {
|
||||||
// An instance is already running and we asked for
|
// An instance is already running and we asked for
|
||||||
@@ -444,10 +457,13 @@ BApplication::InitData(const char *signature, status_t *_error)
|
|||||||
|
|
||||||
// Return the error or exit, if there was an error and no error variable
|
// Return the error or exit, if there was an error and no error variable
|
||||||
// has been supplied.
|
// has been supplied.
|
||||||
if (_error)
|
if (_error) {
|
||||||
*_error = fInitError;
|
*_error = fInitError;
|
||||||
else if (fInitError != B_OK)
|
} else if (fInitError != B_OK) {
|
||||||
|
DBG(OUT("BApplication::InitData() failed: %s\n", strerror(fInitError)));
|
||||||
exit(0);
|
exit(0);
|
||||||
|
}
|
||||||
|
DBG(OUT("BApplication::InitData() done\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user