]> git.ipfire.org Git - thirdparty/util-linux.git/commit
unshare: fix busyloop and reduce racing probability
authorYuriy M. Kaminskiy <yumkam@gmail.com>
Sat, 30 Jan 2016 13:18:39 +0000 (16:18 +0300)
committerKarel Zak <kzak@redhat.com>
Wed, 17 Feb 2016 12:54:56 +0000 (13:54 +0100)
commit99fcafdf5f9c8cf7dedeeb1246210013da58dfd7
tree9145744cae664d5561a0d342a14f52c1a68ba3a4
parentd689166b11c5ee89a754d46cc1ce09f27bde0a31
unshare: fix busyloop and reduce racing probability

Replace busy-loop with waiting on pipe from parent.

Note: reduces racing probability, but still there are window where
it is possible (if parent unshare process will be [externally] killed
between successful read(fds[0]) and mount() calls).

[kzak@redhat.com: - use all-io.h to avoid loops around write() and read(),
                  - use less generic 0x06 byte to sync parent and child]

Signed-off-by: Yuriy M. Kaminskiy <yumkam@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/unshare.c