]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
src/libcgroup-internal: drop dirent/mntent includes
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Fri, 1 May 2026 09:44:09 +0000 (15:14 +0530)
committerTom Hromatka (Oracle) <tom.hromatka@gmail.com>
Thu, 14 May 2026 18:17:16 +0000 (12:17 -0600)
src/libcgroup-internal.h includes <dirent.h> and <mntent.h>, but only
uses pointer types in function declarations.

Replace the heavy includes with forward declarations:
- add struct dirent;
- add struct mntent;
- remove <dirent.h> and <mntent.h> from the internal header

This trims transitive header dependencies and reduces compile noise,
with no functional change.

Build tested with:
  make -j4

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka (Oracle) <tom.hromatka@gmail.com>
src/libcgroup-internal.h

index 209b53d06f8a098855b3b8dc3ebe48cfb37b3396..cd8c3a25abb2206df37dc39eebbc6159876a6020 100644 (file)
@@ -18,15 +18,16 @@ extern "C" {
 #include <libcgroup.h>
 
 #include <pthread.h>
-#include <dirent.h>
 #include <limits.h>
-#include <mntent.h>
 #include <setjmp.h>
 #include <fts.h>
 
 #include <sys/stat.h>
 #include <sys/types.h>
 
+struct dirent;
+struct mntent;
+
 #define MAX_MNT_ELEMENTS       17      /* Maximum number of mount points/controllers */
 #define MAX_GROUP_ELEMENTS     128     /* Estimated number of groups created */