mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-25 09:26:27 -05:00
Report smartctl open failures as unknown power state
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
This commit is contained in:
parent
720073d80d
commit
226de01ba4
5 changed files with 28 additions and 6 deletions
|
|
@ -1750,12 +1750,17 @@ retry:
|
|||
log_tag("attr:%s:%s:power:standby\n", file, name);
|
||||
*power = POWER_STANDBY;
|
||||
} else {
|
||||
log_tag("attr:%s:%s:power:active\n", file, name);
|
||||
*power = POWER_ACTIVE;
|
||||
|
||||
/* store the smartctl return value */
|
||||
if (smart)
|
||||
smart[SMART_FLAGS].raw = WEXITSTATUS(ret);
|
||||
|
||||
if (WEXITSTATUS(ret) & SMARTCTL_FLAG_OPEN) {
|
||||
log_tag("attr:%s:%s:power:unknown\n", file, name);
|
||||
*power = POWER_UNKNOWN;
|
||||
} else {
|
||||
log_tag("attr:%s:%s:power:active\n", file, name);
|
||||
*power = POWER_ACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -3797,12 +3797,17 @@ static int devprobe(dev_t device, const char* name, const char* smartctl, const
|
|||
log_tag("attr:%s:%s:power:standby\n", file, name);
|
||||
*power = POWER_STANDBY;
|
||||
} else {
|
||||
log_tag("attr:%s:%s:power:active\n", file, name);
|
||||
*power = POWER_ACTIVE;
|
||||
|
||||
/* store the smartctl return value */
|
||||
if (smart)
|
||||
smart[SMART_FLAGS].raw = WEXITSTATUS(ret);
|
||||
|
||||
if (WEXITSTATUS(ret) & SMARTCTL_FLAG_OPEN) {
|
||||
log_tag("attr:%s:%s:power:unknown\n", file, name);
|
||||
*power = POWER_UNKNOWN;
|
||||
} else {
|
||||
log_tag("attr:%s:%s:power:active\n", file, name);
|
||||
*power = POWER_ACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue