cleanup: PLOG(FATAL) crashes, does not need else branch
Change-Id: I49a439d444dc9f566a05bab23d8cfd06ce56d4a6
This commit is contained in:
parent
57db6f453c
commit
c4b24f70e6
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