Support the case of device not in smartctl database

This commit is contained in:
Andrea Mazzoleni 2015-01-29 22:52:17 +01:00
parent a02ea3da76
commit cd1186e434
4 changed files with 4 additions and 17 deletions

View file

@ -655,13 +655,6 @@ static int devsmart(dev_t device, uint64_t* smart, char* serial)
return -1;
/* LCOV_EXCL_STOP */
}
/* check only first bit, as other bits are used to report other conditions */
if ((WEXITSTATUS(ret) & 1) != 0) {
/* LCOV_EXCL_START */
fprintf(stderr, "Failed to run smartctl -a on device '%u:%u' with return code %xh.\n", major(device), minor(device), WEXITSTATUS(ret));
return -1;
/* LCOV_EXCL_STOP */
}
/* store the return smartctl return value */
smart[SMART_FLAGS] = WEXITSTATUS(ret);