]> git.ipfire.org Git - thirdparty/util-linux.git/commit
login-utils: include libgen.h for basename API
authorKhem Raj <raj.khem@gmail.com>
Mon, 4 Dec 2023 03:59:46 +0000 (19:59 -0800)
committerKhem Raj <raj.khem@gmail.com>
Mon, 4 Dec 2023 04:57:38 +0000 (20:57 -0800)
commit77454e58d58f904cfdc02d3ca5bb65f1bd8739fc
tree92fe425ce928a6cfb85733f615607ca731aaeb8c
parent608d4840f8f191529108fc2bdc0dd3dcb4bb7ab8
login-utils: include libgen.h for basename API

musl has removed the non-prototype declaration of basename from string.h [1] which now results in build errors with clang-17+ compiler

include libgen.h for using the posix declaration of the funciton.

Fixes

../util-linux-2.39.2/login-utils/su-common.c:847:20: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  847 |                 shell_basename = basename(shell);
      |                                  ^

[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7

Signed-off-by: Khem Raj <raj.khem@gmail.com>
login-utils/su-common.c