script: don't wait for empty descriptors if child is dead

The current code waits for empty file master and slave descriptors,
but it makes sense only if there is child process that cares (read)
about data in the descriptors.

Signed-off-by: Karel Zak <kzak@redhat.com>
script: fix inconsistent -q, use poll() rather then O_NONBLOCK

 - don't suppress "Script done" message in typescript file by -q
   (note that -q has no effect to "Script started" message)

 - simplify the code by poll()

Signed-off-by: Karel Zak <kzak@redhat.com>
script: use all-io.h to make the code more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
wipefs: add comments to code
libblkid: no more probe for btrfs backup superblock

 * Linux kernel cares about the first superblock only

 * backup superblock are FS specific stuff and there is no reason to
   care about it in generic tools

 * the problem with broken btrfs utils has been already fixed (it was
   possible to use the utils on filesystem with erased primary
   superblok without any warning message).

Signed-off-by: Karel Zak <kzak@redhat.com>
mkswap: fix compiler warning [-Wunused-variable]

Signed-off-by: Karel Zak <kzak@redhat.com>
build-sys: fstrim depends on libmount

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: update build-sys tests

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid: detect alone PMBR

wipefs(8) has to also erase PMBR, not GPR header only, otherwise the
device could be still interpreted as a device with a partition table.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1054186
Signed-off-by: Karel Zak <kzak@redhat.com>
wipefs: call BLKRRPART when erase partition table

It's better to be smart than make things inconsistent (without
BLKRRPART kernel still uses the erased PT and udev-db still contains
obsolete information).

Signed-off-by: Karel Zak <kzak@redhat.com>
flock: Change the 'exit status' man page section to make more sense

Signed-off-by: Wieland Hoffmann <themineo@gmail.com>