From: Alejandro Colomar Date: Wed, 22 Apr 2026 09:21:14 +0000 (+0200) Subject: lib/, src/: Move btrfs.c prototypes to lib/btrfs.h X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96460c7240264c0022cebc9ba1774993ee2594cf;p=thirdparty%2Fshadow.git lib/, src/: Move btrfs.c prototypes to lib/btrfs.h Signed-off-by: Alejandro Colomar --- diff --git a/lib/Makefile.am b/lib/Makefile.am index 7c488f826..0664e610d 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -290,7 +290,7 @@ libshadow_la_SOURCES += tcbfuncs.c tcbfuncs.h endif if WITH_BTRFS -libshadow_la_SOURCES += btrfs.c +libshadow_la_SOURCES += btrfs.c btrfs.h endif if ENABLE_LASTLOG diff --git a/lib/btrfs.c b/lib/btrfs.c index 065c79387..15b6b3152 100644 --- a/lib/btrfs.c +++ b/lib/btrfs.c @@ -1,3 +1,7 @@ +#include "config.h" + +#include "btrfs.h" + #include #include #include diff --git a/lib/btrfs.h b/lib/btrfs.h new file mode 100644 index 000000000..50b704882 --- /dev/null +++ b/lib/btrfs.h @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: 2026, Alejandro Colomar +// SPDX-License-Identifier: BSD-3-Clause + + +#ifndef SHADOW_INCLUDE_LIB_BTRFS_H_ +#define SHADOW_INCLUDE_LIB_BTRFS_H_ + + +#include "config.h" + +#include +#include + + +#ifdef WITH_BTRFS +int btrfs_create_subvolume(const char *path); +int btrfs_remove_subvolume(const char *path); +int btrfs_is_subvolume(const char *path); +bool is_btrfs(const struct statfs *sfs); +#endif + + +#endif // include guard diff --git a/lib/prototypes.h b/lib/prototypes.h index 42aa29230..d22c477ae 100644 --- a/lib/prototypes.h +++ b/lib/prototypes.h @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -50,14 +49,6 @@ extern int expire (const struct passwd *, /*@null@*/const struct spwd *); /* isexpired.c */ extern int isexpired (const struct passwd *, /*@null@*/const struct spwd *); -/* btrfs.c */ -#ifdef WITH_BTRFS -extern int btrfs_create_subvolume(const char *path); -extern int btrfs_remove_subvolume(const char *path); -extern int btrfs_is_subvolume(const char *path); -extern bool is_btrfs(const struct statfs *sfs); -#endif - /* basename() renamed to Basename() to avoid libc name space confusion */ /* basename.c */ extern /*@observer@*/const char *Basename (const char *str); diff --git a/src/useradd.c b/src/useradd.c index 5ce6cd6a2..9bd32b11a 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -34,6 +34,7 @@ #include "alloc/malloc.h" #include "atoi/a2i.h" #include "atoi/getnum.h" +#include "btrfs.h" #include "chkname.h" #include "defines.h" #include "faillog.h" diff --git a/src/userdel.c b/src/userdel.c index 9b7d81bed..ebd064c06 100644 --- a/src/userdel.c +++ b/src/userdel.c @@ -20,6 +20,7 @@ #include #include +#include "btrfs.h" #include "defines.h" #include "getdef.h" #include "groupio.h" diff --git a/src/usermod.c b/src/usermod.c index 7c0321a6c..3afe19ea4 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -32,6 +32,7 @@ #include "alloc/malloc.h" #include "atoi/a2i.h" #include "atoi/getnum.h" +#include "btrfs.h" #include "chkname.h" #include "defines.h" #include "faillog.h"