]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib: split ul_default_shell() from shells.c into default_shell.c
authorKarel Zak <kzak@redhat.com>
Mon, 4 May 2026 11:57:41 +0000 (13:57 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 11 May 2026 09:05:41 +0000 (11:05 +0200)
commit97cd9a70e7bf20a967cc25b1b577e23ebe472628
tree655936df3fc66625aa732fd45bbca568f6663a8f
parent41cada296fd73890c23fbd45b235a14de2088ebe
lib: split ul_default_shell() from shells.c into default_shell.c

Move ul_default_shell() and UL_SHELL_* flags into a new
lib/default_shell.c and include/default_shell.h pair, and add the
new file to libcommon (autotools and meson).

ul_default_shell() has no dependency on libeconf -- it simply checks
$SHELL, passwd, and falls back to _PATH_BSHELL. Separating it from
shells.c (which depends on libeconf for /etc/shells enumeration)
allows binaries that only need the default shell lookup (flock,
script, scriptlive, more, exec_shell.c users) to avoid unnecessary
libeconf linkage.

Update callers that only use ul_default_shell() to include
default_shell.h instead of shells.h.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 files changed:
include/Makemodule.am
include/default_shell.h [new file with mode: 0644]
include/shells.h
lib/Makemodule.am
lib/default_shell.c [new file with mode: 0644]
lib/exec_shell.c
lib/meson.build
lib/shells.c
sys-utils/flock.c
term-utils/script.c
term-utils/scriptlive.c
text-utils/more.c