Skip to content

src/w.c: use utmp.h only

This addresses the following failure on musl systems:

| ../git/src/w.c: In function 'print_from':
| ../git/src/w.c:73:28: error: '__UT_HOSTSIZE' undeclared (first use in this function); did you mean 'UT_HOSTSIZE'?
|    73 | #       define UT_HOSTSIZE __UT_HOSTSIZE
|       |                            ^~~~~~~~~~~~~
| ../git/src/w.c:233:64: note: in expansion of macro 'UT_HOSTSIZE'
|   233 |                         print_display_or_interface(u->ut_host, UT_HOSTSIZE, fromlen - len);
|       |                                                                ^~~~~~~~~~~
|

It is caused by including utmpx.h, but not utmp.h, which (on musl) lacks the needed definitions.

I have verified that both musl and glibc based builds continue to work.

Signed-off-by: Alexander Kanavin alex@linutronix.de

Edited by Alexander Kanavin

Merge request reports