summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-03-19 01:19:21 +0100
committerLennart Poettering <lennart@poettering.net>2009-03-19 01:19:21 +0100
commit3aa14f7fdea35e55be01217af666e6d42f3ebb48 (patch)
treeeb9788ed7b60d311c5b0e16377c66fcbc76e0298
parentb4b54d3b0b700da72c3ff927d0418418e58c346e (diff)
handle the good status of bad sector attributes especially
-rw-r--r--atasmart.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/atasmart.c b/atasmart.c
index 8580a4c..743ecaa 100644
--- a/atasmart.c
+++ b/atasmart.c
@@ -1331,6 +1331,16 @@ int sk_disk_smart_parse_attributes(SkDisk *d, SkSmartAttributeParseCallback cb,
find_threshold(d, &a);
+ /* Handle a few fields specially */
+ if ((!strcmp(a.name, "reallocated-sector-count") ||
+ !strcmp(a.name, "reallocated-event-count") ||
+ !strcmp(a.name, "current-pending-sector")) &&
+ a.pretty_unit == SK_SMART_ATTRIBUTE_UNIT_SECTORS &&
+ a.pretty_value > 0) {
+ a.good = FALSE;
+ a.good_valid = TRUE;
+ }
+
cb(d, &a, userdata);
free(an);