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
This commit is contained in:
Michael Lotz 2008-09-22 18:15:50 +00:00
parent dde69daea3
commit f8b51708a6

View File

@ -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;
}