mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 23:27:46 +00:00
[posix-app] enhance RCP failure info (#3950)
By default, posix-app disables platform region logs. Even when platform logs are enabled, logs are sent to syslog without printing to stderr. This commit prints error information to stderr on exit, providing the user more direct information about failures. This commit also eliminates the "wait no child process" error message.
This commit is contained in:
@@ -171,8 +171,8 @@ void HdlcInterface::Deinit(void)
|
||||
{
|
||||
VerifyOrExit(mSockFd != -1);
|
||||
|
||||
VerifyOrExit(0 == close(mSockFd), perror("close NCP"));
|
||||
VerifyOrExit(-1 != wait(NULL), perror("wait NCP"));
|
||||
VerifyOrExit(0 == close(mSockFd), perror("close RCP"));
|
||||
VerifyOrExit(-1 != wait(NULL) || errno == ECHILD, perror("wait RCP"));
|
||||
|
||||
mSockFd = -1;
|
||||
|
||||
|
||||
@@ -112,6 +112,8 @@ void SuccessOrDie(otError aError)
|
||||
}
|
||||
|
||||
otLogCritPlat("Error: %s", otThreadErrorToString(aError));
|
||||
// For better user experience.
|
||||
fprintf(stderr, "Error: %s\r\n", otThreadErrorToString(aError));
|
||||
exit(exitCode);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user