diff options
| author | Congcong Kuo <congcong.kuo@gmail.com> | 2025-05-25 22:22:50 +0800 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-05-25 17:47:03 +0200 |
| commit | e3bd9a65ccc3139eb1a79791bd0dd649fb053bfd (patch) | |
| tree | 01982efb2dbecf5123efdaea81f6f8048aca76ae /nix | |
| parent | c28fea0acae92f6475650bf136f171f5fc240971 (diff) | |
daemon: Remove ‘defined’ in macro definition.
Closes #6.
* nix/libstore/build.cc (CHROOT_ENABLED, CLONE_ENABLED): Wrap in #ifdefs.
Change-Id: I217e46fc2cac579a199fcd7c28ef5a8155a12750
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'nix')
| -rw-r--r-- | nix/libstore/build.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index a1f39d9a8bf..9701af8079e 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -55,8 +55,17 @@ #endif -#define CHROOT_ENABLED HAVE_CHROOT && HAVE_SYS_MOUNT_H && defined(MS_BIND) && defined(MS_PRIVATE) -#define CLONE_ENABLED defined(CLONE_NEWNS) +#if defined(MS_BIND) && defined(MS_PRIVATE) +#define CHROOT_ENABLED HAVE_CHROOT && HAVE_SYS_MOUNT_H +#else +#define CHROOT_ENABLED 0 +#endif + +#if defined(CLONE_NEWNS) +#define CLONE_ENABLED 1 +#else +#define CLONE_ENABLED 0 +#endif #if defined(SYS_pivot_root) #define pivot_root(new_root, put_old) (syscall(SYS_pivot_root, new_root,put_old)) |
