tests: write tests/failures to build- instead of srcdir

All other test output goes to builddir too and moreover "make distcheck"
complains about writing to it's read-only srcdir.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: return error if failures file not usable

In past this could happen when doing make distcheck.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
build-sys: libmount/python/__init__.py is always a dist file

"make dist" and "make distcheck" should work after a bare
./configure to give us a full featured tar ball.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: try hard to create swaplabel's test image

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
cfdisk: fix typo (undeclared variable since b1f58330)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
cfdisk: fix compile-time error fixes #59

+ For compile to work also needs pull request #56 applied
libfdisk: clean up debug output

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: properly implement read-only mode

Don't use fallback to read-only mode in fdisk_context_assign_device(),
it's application responsibility open the device in the right mode.

The commands fdisk and cfdisk check (and report) read-only mode now.

Reported-by: Maciej Małecki <me@mmalecki.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Merge branch 'master' of https://github.com/rudimeier/util-linux

* 'master' of https://github.com/rudimeier/util-linux:
  tests: try hard to create swaplabel's test image
  build-sys: libmount/python/__init__.py is always a dist file
  tests: return error if failures file not usable
  tests: write tests/failures to build- instead of srcdir
Merge branch 'cfdisk-fix-typo' of https://github.com/rudimeier/util-linux

* 'cfdisk-fix-typo' of https://github.com/rudimeier/util-linux:
  cfdisk: fix typo (undeclared variable since b1f58330)
Merge branch 'fix-compile-color-cfdisk' of https://github.com/theonewolf/util-linux

* 'fix-compile-color-cfdisk' of https://github.com/theonewolf/util-linux:
  cfdisk: fix compile-time error fixes #59
flock: use nfs4 fallback on EBADF too

The kernel regression (probably v3.4, commit 55725513) introduces a
new errno for O_RDONLY on NFS. Now it returns EBADF rather than EIO.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1078618
Signed-off-by: Karel Zak <kzak@redhat.com>