1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-27 13:57:26 +03:00

glibc: Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36

(cherry picked from commit 3657d3a01c7e25ff86d7a4642065b367c4ff7484)
(cherry picked from commit 8fe0c121787efe16c2a7a0f27a3d9862d0a12c81)
This commit is contained in:
Rudi Heitbaum 2022-07-23 10:38:49 +00:00 committed by Zbigniew Jędrzejewski-Szmek
parent 0e7214c8b5
commit 998b08ec5f
3 changed files with 16 additions and 1 deletions

View File

@ -482,7 +482,6 @@ decl_headers = '''
#include <uchar.h> #include <uchar.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <linux/fs.h>
''' '''
foreach decl : ['char16_t', foreach decl : ['char16_t',
@ -494,6 +493,17 @@ foreach decl : ['char16_t',
# We get -1 if the size cannot be determined # We get -1 if the size cannot be determined
have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0 have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0
if decl == 'struct mount_attr'
if have
want_linux_fs_h = false
else
have = cc.sizeof(decl,
prefix : decl_headers + '#include <linux/fs.h>',
args : '-D_GNU_SOURCE') > 0
want_linux_fs_h = have
endif
endif
if decl == 'struct statx' if decl == 'struct statx'
if have if have
want_linux_stat_h = false want_linux_stat_h = false
@ -509,6 +519,7 @@ foreach decl : ['char16_t',
endforeach endforeach
conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h) conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h)
conf.set10('WANT_LINUX_FS_H', want_linux_fs_h)
foreach ident : ['secure_getenv', '__secure_getenv'] foreach ident : ['secure_getenv', '__secure_getenv']
conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident)) conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))

View File

@ -7,7 +7,9 @@
#include <sys/file.h> #include <sys/file.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <unistd.h> #include <unistd.h>
#if WANT_LINUX_FS_H
#include <linux/fs.h> #include <linux/fs.h>
#endif
#include "alloc-util.h" #include "alloc-util.h"
#include "base-filesystem.h" #include "base-filesystem.h"

View File

@ -7,7 +7,9 @@
#include <sys/statvfs.h> #include <sys/statvfs.h>
#include <unistd.h> #include <unistd.h>
#include <linux/loop.h> #include <linux/loop.h>
#if WANT_LINUX_FS_H
#include <linux/fs.h> #include <linux/fs.h>
#endif
#include "alloc-util.h" #include "alloc-util.h"
#include "chase-symlinks.h" #include "chase-symlinks.h"