]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/, src/: Move btrfs.c prototypes to lib/btrfs.h
authorAlejandro Colomar <alx@kernel.org>
Wed, 22 Apr 2026 09:21:14 +0000 (11:21 +0200)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Thu, 23 Apr 2026 12:17:18 +0000 (14:17 +0200)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/Makefile.am
lib/btrfs.c
lib/btrfs.h [new file with mode: 0644]
lib/prototypes.h
src/useradd.c
src/userdel.c
src/usermod.c

index 7c488f8266bf612acda4db26abe43ccc4b1c7136..0664e610d9cf271c76b390b6c0f41cf2e104047d 100644 (file)
@@ -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
index 065c79387cdbbd94a2f50414363b3190299ab9cc..15b6b3152e7f4320242423190e09f65af16bce1b 100644 (file)
@@ -1,3 +1,7 @@
+#include "config.h"
+
+#include "btrfs.h"
+
 #include <linux/btrfs_tree.h>
 #include <linux/magic.h>
 #include <sys/statfs.h>
diff --git a/lib/btrfs.h b/lib/btrfs.h
new file mode 100644 (file)
index 0000000..50b7048
--- /dev/null
@@ -0,0 +1,23 @@
+// SPDX-FileCopyrightText: 2026, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#ifndef SHADOW_INCLUDE_LIB_BTRFS_H_
+#define SHADOW_INCLUDE_LIB_BTRFS_H_
+
+
+#include "config.h"
+
+#include <stdbool.h>
+#include <sys/statfs.h>
+
+
+#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
index 42aa29230543479ffc70054c735c30b850d20a0e..d22c477ae144f9a02d6cb28292289251d29e154a 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <sys/socket.h>
 #include <sys/stat.h>
-#include <sys/statfs.h>
 #include <sys/types.h>
 #include <pwd.h>
 #include <grp.h>
@@ -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);
index 5ce6cd6a2f0cf7ee47047c4aabfe36617f27f5b5..9bd32b11a104ba5ab50d04b3dc1539753fa73de9 100644 (file)
@@ -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"
index 9b7d81bedd9703567b639246801e2d8534709c46..ebd064c061be6de794289a163e3b790f77d5064d 100644 (file)
@@ -20,6 +20,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#include "btrfs.h"
 #include "defines.h"
 #include "getdef.h"
 #include "groupio.h"
index 7c0321a6c180e9560fef5c393c3a7b5959966df1..3afe19ea4c0b950f9e023f0f0eb88dc3dfbfa121 100644 (file)
@@ -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"