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:
parent
dde69daea3
commit
f8b51708a6
@ -186,8 +186,10 @@ BMessageRunner::GetInfo(bigtime_t *interval, int32 *count) const
|
|||||||
*interval = _interval;
|
*interval = _interval;
|
||||||
} else
|
} else
|
||||||
error = B_ERROR;
|
error = B_ERROR;
|
||||||
} else
|
} else {
|
||||||
reply.FindInt32("error", &error);
|
if (reply.FindInt32("error", &error) != B_OK)
|
||||||
|
error = B_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@ -337,8 +339,10 @@ BMessageRunner::_RegisterRunner(BMessenger target, const BMessage *message,
|
|||||||
if (reply.what == B_REG_SUCCESS) {
|
if (reply.what == B_REG_SUCCESS) {
|
||||||
if (reply.FindInt32("token", &token) != B_OK)
|
if (reply.FindInt32("token", &token) != B_OK)
|
||||||
error = B_ERROR;
|
error = B_ERROR;
|
||||||
} else
|
} else {
|
||||||
reply.FindInt32("error", &error);
|
if (reply.FindInt32("error", &error) != B_OK)
|
||||||
|
error = B_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error == B_OK)
|
if (error == B_OK)
|
||||||
@ -391,8 +395,10 @@ BMessageRunner::_SetParams(bool resetInterval, bigtime_t interval,
|
|||||||
|
|
||||||
// evaluate the reply
|
// evaluate the reply
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
if (reply.what != B_REG_SUCCESS)
|
if (reply.what != B_REG_SUCCESS) {
|
||||||
reply.FindInt32("error", &error);
|
if (reply.FindInt32("error", &error) != B_OK)
|
||||||
|
error = B_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user