container: Allow 'container-excursion' to the same namespaces.
authorLudovic Courtès <ludo@gnu.org>
Tue, 18 Oct 2016 21:22:03 +0000 (23:22 +0200)
committerLudovic Courtès <ludo@gnu.org>
Wed, 19 Oct 2016 13:54:10 +0000 (15:54 +0200)
commit7fee5b53973fb4fe049aa0bc5db58093727bdf30
treeb392d7b204098a4dfa3113c7d7fa7f801de11546
parent99df12cd1921dd497bb4fcdd96ee40e358d71e6d
container: Allow 'container-excursion' to the same namespaces.

Before that, 'container-excursion' would call 'setns' even when the
target namespace is the one the caller is already in, which would fail.

* gnu/build/linux-container.scm (container-excursion): Introduce
'source' and 'target'.  Compare the result of 'readlink' on these
instead of comparing file descriptors to decide whether to call
'setns'.
* tests/containers.scm ("container-excursion, same namespace"): New test.
gnu/build/linux-container.scm
tests/containers.scm