guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] daemon: Break CHROOT_ENABLED into smaller macros.


From: Ludovic Courtès
Subject: Re: [PATCH] daemon: Break CHROOT_ENABLED into smaller macros.
Date: Wed, 07 Sep 2016 10:18:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Hi!

Manolis Ragkousis <address@hidden> skribis:

> From aea4bf23b699b7ef5d7007b81f296b77324d5b6c Mon Sep 17 00:00:00 2001
> From: Manolis Ragkousis <address@hidden>
> Date: Sun, 7 Aug 2016 17:48:30 +0300
> Subject: [PATCH] daemon: Break CHROOT_ENABLED into smaller macros.
>
> We need to check for CLONE_NEWNS only when we want to use the
> Linux specific clone(). Otherwise we use fork().  Also we define
> pivot_root() only if SYS_pivot_root is defined.

Nipick: it’s enough to write 'clone', without parentheses (info
"(standards) GNU Manuals").

> * nix/libstore/build.cc (CHROOT_ENABLED): Break into CHROOT_ENABLED
> and CLONE_ENABLED.  Define pivot_root() only if SYS_pivot_root is defined.
> (DerivationGoal::startBuilder): Replace CHROOT_ENABLED with CLONE_ENABLED.

[...]

> --- a/nix/libstore/build.cc
> +++ b/nix/libstore/build.cc
> @@ -51,7 +51,12 @@
>  #include <linux/fs.h>
>  #endif
>  
> -#define CHROOT_ENABLED HAVE_CHROOT && HAVE_SYS_MOUNT_H && defined(MS_BIND) 
> && defined(MS_PRIVATE) && defined(CLONE_NEWNS) && defined(SYS_pivot_root)
> +#define CHROOT_ENABLED HAVE_CHROOT && HAVE_SYS_MOUNT_H && defined(MS_BIND) 
> && defined(MS_PRIVATE)
> +#define CLONE_ENABLED defined(CLONE_NEWNS)

This a misleading name, and I think it’s best to directly use #ifdef
CLONE_NEWNS.

> +#if defined(SYS_pivot_root)
> +#define pivot_root(new_root, put_old) (syscall(SYS_pivot_root, 
> new_root,put_old))
    ^
Insert space here.

>         - The UTS namespace ensures that builders see a hostname of
>           localhost rather than the actual hostname.
>      */
> -#if CHROOT_ENABLED
> +#if CLONE_ENABLED

#ifdef CLONE_NEWNS.

Could you send an updated patch?

Thank you for being patient enough!

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]