From f8b51708a692ec4e90fc179f09775365266e872c Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Mon, 22 Sep 2008 18:15:50 +0000 Subject: [PATCH] In case there is no error field in the reply message, make sure that we don't continue with B_OK. This also fixes CID 1122 where in such a case an uninitialized token would be returned. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27695 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/app/MessageRunner.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/kits/app/MessageRunner.cpp b/src/kits/app/MessageRunner.cpp index acbdb3d0f6..70db4b451a 100644 --- a/src/kits/app/MessageRunner.cpp +++ b/src/kits/app/MessageRunner.cpp @@ -186,8 +186,10 @@ BMessageRunner::GetInfo(bigtime_t *interval, int32 *count) const *interval = _interval; } else error = B_ERROR; - } else - reply.FindInt32("error", &error); + } else { + if (reply.FindInt32("error", &error) != B_OK) + error = B_ERROR; + } } return error; } @@ -337,8 +339,10 @@ BMessageRunner::_RegisterRunner(BMessenger target, const BMessage *message, if (reply.what == B_REG_SUCCESS) { if (reply.FindInt32("token", &token) != B_OK) error = B_ERROR; - } else - reply.FindInt32("error", &error); + } else { + if (reply.FindInt32("error", &error) != B_OK) + error = B_ERROR; + } } if (error == B_OK) @@ -391,8 +395,10 @@ BMessageRunner::_SetParams(bool resetInterval, bigtime_t interval, // evaluate the reply if (error == B_OK) { - if (reply.what != B_REG_SUCCESS) - reply.FindInt32("error", &error); + if (reply.what != B_REG_SUCCESS) { + if (reply.FindInt32("error", &error) != B_OK) + error = B_ERROR; + } } return error; }