diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index f8794e783..ab66195b8 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -14,7 +14,6 @@ #include "topo-sort.hh" #include "callback.hh" #include "json-utils.hh" -#include "cgroup.hh" #include "personality.hh" #include "current-process.hh" #include "child.hh" @@ -52,6 +51,7 @@ # include # endif # define pivot_root(new_root, put_old) (syscall(SYS_pivot_root, new_root, put_old)) +# include "cgroup.hh" #endif #if __APPLE__ diff --git a/src/libutil/cgroup.cc b/src/libutil/linux/cgroup.cc similarity index 99% rename from src/libutil/cgroup.cc rename to src/libutil/linux/cgroup.cc index de83b5ad1..8b8942643 100644 --- a/src/libutil/cgroup.cc +++ b/src/libutil/linux/cgroup.cc @@ -1,5 +1,3 @@ -#if __linux__ - #include "cgroup.hh" #include "util.hh" #include "file-system.hh" @@ -145,5 +143,3 @@ CgroupStats destroyCgroup(const Path & cgroup) } } - -#endif diff --git a/src/libutil/cgroup.hh b/src/libutil/linux/cgroup.hh similarity index 96% rename from src/libutil/cgroup.hh rename to src/libutil/linux/cgroup.hh index 574ae8e5b..783a0ab87 100644 --- a/src/libutil/cgroup.hh +++ b/src/libutil/linux/cgroup.hh @@ -1,8 +1,6 @@ #pragma once ///@file -#if __linux__ - #include #include @@ -28,5 +26,3 @@ struct CgroupStats CgroupStats destroyCgroup(const Path & cgroup); } - -#endif