Merge "cleanup: PLOG(FATAL) crashes, does not need else branch" into main
This commit is contained in:
commit
4c3ebe4723
1 changed files with 18 additions and 19 deletions
|
@ -303,28 +303,27 @@ static void ReadCrashInfo(unique_fd& fd, siginfo_t* siginfo,
|
|||
*recoverable_crash = false;
|
||||
if (rc == -1) {
|
||||
PLOG(FATAL) << "failed to read target ucontext";
|
||||
} else {
|
||||
ssize_t expected_size = 0;
|
||||
switch (crash_info->header.version) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
expected_size = sizeof(CrashInfoHeader) + sizeof(CrashInfoDataStatic);
|
||||
break;
|
||||
}
|
||||
ssize_t expected_size = 0;
|
||||
switch (crash_info->header.version) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
expected_size = sizeof(CrashInfoHeader) + sizeof(CrashInfoDataStatic);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
expected_size = sizeof(CrashInfoHeader) + sizeof(CrashInfoDataDynamic);
|
||||
break;
|
||||
case 4:
|
||||
expected_size = sizeof(CrashInfoHeader) + sizeof(CrashInfoDataDynamic);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG(FATAL) << "unexpected CrashInfo version: " << crash_info->header.version;
|
||||
break;
|
||||
};
|
||||
default:
|
||||
LOG(FATAL) << "unexpected CrashInfo version: " << crash_info->header.version;
|
||||
break;
|
||||
};
|
||||
|
||||
if (rc < expected_size) {
|
||||
LOG(FATAL) << "read " << rc << " bytes when reading target crash information, expected "
|
||||
<< expected_size;
|
||||
}
|
||||
if (rc < expected_size) {
|
||||
LOG(FATAL) << "read " << rc << " bytes when reading target crash information, expected "
|
||||
<< expected_size;
|
||||
}
|
||||
|
||||
switch (crash_info->header.version) {
|
||||
|
|
Loading…
Reference in a new issue