From: Mark Harfouche Date: Tue, 14 Jan 2025 16:25:19 +0000 (-0500) Subject: refactor things to avoid an other header. X-Git-Tag: v2.42-start~91^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a46fac4cc00947b6b3ea7d94ee5ae2ba228407e1;p=thirdparty%2Futil-linux.git refactor things to avoid an other header. --- diff --git a/lsfd-cmd/lsfd.c b/lsfd-cmd/lsfd.c index c10f0758b..8c5b8456f 100644 --- a/lsfd-cmd/lsfd.c +++ b/lsfd-cmd/lsfd.c @@ -37,10 +37,30 @@ #include #include #include -#include #ifdef HAVE_LINUX_KCMP_H # include +#endif + +/* See proc(5). + * Defined in linux/include/linux/sched.h private header file. */ +#define PF_KTHREAD 0x00200000 /* I am a kernel thread */ + +#include "c.h" +#include "list.h" +#include "closestream.h" +#include "column-list-table.h" +#include "strutils.h" +#include "procfs.h" +#include "fileutils.h" +#include "idcache.h" +#include "pathnames.h" + +#include "lsfd.h" + +// Make sure this ifdef block comes after all the includes since +// c.h is required for the case where the system does not have kcmp.h +#ifdef HAVE_LINUX_KCMP_H static int kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) { @@ -69,22 +89,6 @@ static int kcmp(pid_t pid1 __attribute__((__unused__)), } #endif -/* See proc(5). - * Defined in linux/include/linux/sched.h private header file. */ -#define PF_KTHREAD 0x00200000 /* I am a kernel thread */ - -#include "c.h" -#include "list.h" -#include "closestream.h" -#include "column-list-table.h" -#include "strutils.h" -#include "procfs.h" -#include "fileutils.h" -#include "idcache.h" -#include "pathnames.h" - -#include "lsfd.h" - UL_DEBUG_DEFINE_MASK(lsfd); UL_DEBUG_DEFINE_MASKNAMES(lsfd) = UL_DEBUG_EMPTY_MASKNAMES;