Skip to content

Commit f28d733

Browse files
Markus Mayergregkh
authored andcommitted
thermal/tools/tmon: Include pthread and time headers in tmon.h
[ Upstream commit 0cf51bf ] 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: Markus Mayer <[email protected]> Acked-by: Florian Fainelli <[email protected]> Reviewed-by: Sumeet Pawnikar <[email protected]> Acked-by: Alejandro González <[email protected]> Tested-by: Alejandro González <[email protected]> Fixes: 94f6996 ("tools/thermal: Introduce tmon, a tool for thermal subsystem") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 226935e commit f28d733

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/thermal/tmon/tmon.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
#define NR_LINES_TZDATA 1
2828
#define TMON_LOG_FILE "/var/tmp/tmon.log"
2929

30+
#include <sys/time.h>
31+
#include <pthread.h>
32+
3033
extern unsigned long ticktime;
3134
extern double time_elapsed;
3235
extern unsigned long target_temp_user;

0 commit comments

Comments
 (0)