ACK: [PATCH 2/2] lib: fwts_ac_adapter: fix failing to find AC directory
ivanhu
ivan.hu at canonical.com
Mon Jan 14 09:56:56 UTC 2019
On 1/10/19 1:34 PM, Alex Hung wrote:
> Some BIOS names adapter device "AC" which has length of 2. As a result,
> it always fails to get AC directory. This removes the condition to have
> directory name greater than 2.
>
> Signed-off-by: Alex Hung <alex.hung at canonical.com>
> ---
> src/lib/src/fwts_ac_adapter.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_ac_adapter.c b/src/lib/src/fwts_ac_adapter.c
> index de2242a2..fbf75b24 100644
> --- a/src/lib/src/fwts_ac_adapter.c
> +++ b/src/lib/src/fwts_ac_adapter.c
> @@ -103,7 +103,7 @@ int fwts_ac_adapter_get_state(const int state, int *matching, int *not_matching)
> return FWTS_ERROR;
> do {
> entry = readdir(ac_power_dir);
> - if (entry && strlen(entry->d_name) > 2) {
> + if (entry) {
> char path[PATH_MAX];
> char *data;
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list