diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-06-04 11:08:44 +0200 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2020-06-05 18:04:11 +0200 |
commit | c340980b80b9ef0c957fe832e93e5ef430b216ac (patch) | |
tree | c34dbd72c6f726e5d139e7f05177239a1188e669 /src | |
parent | 19cfe9b15c223d59390efb7e5f3439df6b952ff5 (diff) |
is_kernfs: Check only defined magic numbers
Avoid undeclared identifiers when compiling with older kernel headers.
Diffstat (limited to 'src')
-rw-r--r-- | src/dir_scan.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/dir_scan.c b/src/dir_scan.c index e145ac2..03a582b 100644 --- a/src/dir_scan.c +++ b/src/dir_scan.c @@ -63,18 +63,45 @@ static struct dir_ext buf_ext[1]; int exclude_kernfs; /* Exclude Linux pseudo filesystems */ static int is_kernfs(unsigned long type) { - if(type == BINFMTFS_MAGIC || + if( +#ifdef BINFMTFS_MAGIC + type == BINFMTFS_MAGIC || +#endif +#ifdef BPF_FS_MAGIC type == BPF_FS_MAGIC || +#endif +#ifdef CGROUP_SUPER_MAGIC type == CGROUP_SUPER_MAGIC || +#endif +#ifdef CGROUP2_SUPER_MAGIC type == CGROUP2_SUPER_MAGIC|| +#endif +#ifdef DEBUGFS_MAGIC type == DEBUGFS_MAGIC || +#endif +#ifdef DEVPTS_SUPER_MAGIC type == DEVPTS_SUPER_MAGIC || +#endif +#ifdef PROC_SUPER_MAGIC type == PROC_SUPER_MAGIC || +#endif +#ifdef PSTOREFS_MAGIC type == PSTOREFS_MAGIC || +#endif +#ifdef SECURITYFS_MAGIC type == SECURITYFS_MAGIC || +#endif +#ifdef SELINUX_MAGIC type == SELINUX_MAGIC || +#endif +#ifdef SYSFS_MAGIC type == SYSFS_MAGIC || - type == TRACEFS_MAGIC) +#endif +#ifdef TRACEFS_MAGIC + type == TRACEFS_MAGIC || +#endif + 0 + ) return 1; return 0; |