提交 0cf51bfe 编写于 作者: M Markus Mayer 提交者: Daniel Lezcano

thermal/tools/tmon: Include pthread and time headers in tmon.h

Include sys/time.h and pthread.h in tmon.h, so that types
"pthread_mutex_t" and "struct timeval tv" are known when tmon.h
references them.

Without these headers, compiling tmon against musl-libc will fail with
these errors:

In file included from sysfs.c:31:0:
tmon.h:47:8: error: unknown type name 'pthread_mutex_t'
 extern pthread_mutex_t input_lock;
        ^~~~~~~~~~~~~~~
make[3]: *** [<builtin>: sysfs.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from tui.c:31:0:
tmon.h:54:17: error: field 'tv' has incomplete type
  struct timeval tv;
                 ^~
make[3]: *** [<builtin>: tui.o] Error 1
make[2]: *** [Makefile:83: tmon] Error 2
Signed-off-by: NMarkus Mayer <mmayer@broadcom.com>
Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: NSumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Acked-by: NAlejandro González <alejandro.gonzalez.correo@gmail.com>
Tested-by: NAlejandro González <alejandro.gonzalez.correo@gmail.com>
Fixes: 94f69966 ("tools/thermal: Introduce tmon, a tool for thermal  subsystem")
Link: https://lore.kernel.org/r/20220718031040.44714-1-f.fainelli@gmail.comSigned-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
上级 8b74a003
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
#define NR_LINES_TZDATA 1 #define NR_LINES_TZDATA 1
#define TMON_LOG_FILE "/var/tmp/tmon.log" #define TMON_LOG_FILE "/var/tmp/tmon.log"
#include <sys/time.h>
#include <pthread.h>
extern unsigned long ticktime; extern unsigned long ticktime;
extern double time_elapsed; extern double time_elapsed;
extern unsigned long target_temp_user; extern unsigned long target_temp_user;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册