[PATCH] Fix umount compilation with glibc 2.9 and earlier

Mike Frysinger vapier at gentoo.org
Thu Mar 24 16:07:31 UTC 2016


On 24 Mar 2016 16:42, Veli-Pekka Peltola wrote:
> After c919d561adaf152d9b8834475539e2366c8aa484 umount.c fails to build
> with glibc 2.9 and earlier as MNT_DETACH is undefined.
> 
> Signed-off-by: Veli-Pekka Peltola <veli-pekka.peltola at ray.fi>
> ---
>  util-linux/umount.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/util-linux/umount.c b/util-linux/umount.c
> index 0091097..9fa82a5 100644
> --- a/util-linux/umount.c
> +++ b/util-linux/umount.c
> @@ -44,6 +44,11 @@ static struct mntent *getmntent_r(FILE* stream, struct mntent* result,
>  }
>  #endif
>  
> +/* glibc 2.9 and earlier needs this */
> +#ifndef MNT_DETACH
> +#define MNT_DETACH 0x00000002
> +#endif

this shouldn't be inlined in the code.  look at the top of the file
and you'll see we already have a lot of fallback code there.

that said, init/bootchartd.c & util-linux/switch_root.c duplicate
things a bit too, and we include sys/mount.h in a bunch of places,
so maybe we should grow a new include/mount_.h to hold all this
logic in a common place.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20160324/ea2c01bb/attachment.asc>


More information about the busybox mailing list