Added explanative comment to get_app_path() and fixed the error return value of main_thread_for().

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@827 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2002-08-19 20:21:10 +00:00
parent ba04be1db0
commit 41b5558a3c
+5 -1
View File
@@ -43,6 +43,10 @@
status_t status_t
get_app_path(char *buffer) get_app_path(char *buffer)
{ {
// The only way to get the path to the application's executable seems to
// be to get an image_info of its image, which also contains a path.
// Several images may belong to the team (libraries, add-ons), but only
// the one in question should be typed B_APP_IMAGE.
status_t error = (buffer ? B_OK : B_BAD_VALUE); status_t error = (buffer ? B_OK : B_BAD_VALUE);
image_info info; image_info info;
int32 cookie = 0; int32 cookie = 0;
@@ -98,7 +102,7 @@ main_thread_for(team_id team)
{ {
// For I can't find any trace of how to explicitly get the main thread, // For I can't find any trace of how to explicitly get the main thread,
// I assume the main thread is the one with the least thread ID. // I assume the main thread is the one with the least thread ID.
thread_id thread = -1; thread_id thread = B_BAD_TEAM_ID;
int32 cookie = 0; int32 cookie = 0;
thread_info info; thread_info info;
while (get_next_thread_info(team, &cookie, &info) == B_OK) { while (get_next_thread_info(team, &cookie, &info) == B_OK) {