[PATCH 1/2] lxc: containter: fix build with glibc 2.36

Cole Robinson posted 2 patches 3 years, 6 months ago
[PATCH 1/2] lxc: containter: fix build with glibc 2.36
Posted by Cole Robinson 3 years, 6 months ago
With glibc 2.36, sys/mount.h and linux/mount.h conflict:
https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E

lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
linux/mount.h.

linux/fs.h isn't required here though. glibc sys/mount.h has had
MS_MOVE since 2.12 in 2010

Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 src/lxc/lxc_container.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index b5278831da..a5401c2186 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -33,9 +33,6 @@
 /* Yes, we want linux private one, for _syscall2() macro */
 #include <linux/unistd.h>
 
-/* For MS_MOVE */
-#include <linux/fs.h>
-
 #if WITH_CAPNG
 # include <cap-ng.h>
 #endif
-- 
2.36.1
Re: [PATCH 1/2] lxc: containter: fix build with glibc 2.36
Posted by Erik Skultety 3 years, 6 months ago
On Mon, Aug 01, 2022 at 03:59:14PM -0400, Cole Robinson wrote:
> With glibc 2.36, sys/mount.h and linux/mount.h conflict:
> https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
> 
> lxc_container.c imports sys/mount.h and linux/fs.h, which pulls in
> linux/mount.h.
> 
> linux/fs.h isn't required here though. glibc sys/mount.h has had
> MS_MOVE since 2.12 in 2010
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>  src/lxc/lxc_container.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
> index b5278831da..a5401c2186 100644
> --- a/src/lxc/lxc_container.c
> +++ b/src/lxc/lxc_container.c
> @@ -33,9 +33,6 @@
>  /* Yes, we want linux private one, for _syscall2() macro */
>  #include <linux/unistd.h>
>  
> -/* For MS_MOVE */
> -#include <linux/fs.h>
> -
>  #if WITH_CAPNG
>  # include <cap-ng.h>
>  #endif
> -- 
> 2.36.1
> 

Reviewed-by: Erik Skultety <eskultet@redhat.com>