David,

On the first call to the cpu_freq|cpu_iowait user may see an initial n/a result
because NULL is returned but the value has been parsed correctly.

Example:

[CPU n/a%] [RAM 52%] [ 2018-04-16 15:55:19 ]
[CPU  16%] [RAM 52%] [ 2018-04-16 15:55:20 ]
[CPU   2%] [RAM 52%] [ 2018-04-16 15:55:21 ]

thanks for your patch but I did not quite understand it.

-       if (!valid) {
+       if (!valid)
                valid = 1;
-               return NULL;
-       }

First of all, that change removes the "return" statement which makes the code totally useless.

Secondly, returning "unknown_str" for the first run of cpu_*() makes totally sense as those are average values between two executions.

Regards,
Aaron

--
Web: https://drkhsh.at/ or http://drkhsh5rv6pnahas.onion/
Gopher: gopher://drkhsh.at or gopher://drkhsh5rv6pnahas.onion
GPG: 0x7A65E38D55BE96FE
Fingerprint: 4688 907C 8720 3318 0D9F AFDE 7A65 E38D 55BE 96FE

Reply via email to