findmnt: test for fstype/options/maj:min before source and target

This change allows to exclude for example NFS mountpoint:

  findmnt --fstab --target /mnt/foo --type nonfs

to stall on a stalled nfs mount.

Signed-off-by: Karel Zak <kzak@redhat.com>
renice: exit with non-zero value when arguments cause warnings

This commit also fixes potential error counter wrap, which theoretically
could make command to exit with a success when it internally failed just
correct amount of times.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sfdisk: use libc error printing function, and symbolic exit values

The commit removes all references to perror(), and replaces them with
either warn() or err().

References: http://marc.info/?l=util-linux-ng&m=137060043804592&w=2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sfdisk: clean up usage() functions

Includes removal of unhide usage function, which was never implemented.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sfdisk: use program_invocation_short_name to determine program name

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
docs: correct sfdisk --activate instructions

The activate can be enabled by renaming the command to 'activate'.  Quite
confusingly the option and command arguments are interchangeable, and
depending on which one is defined as --activate option argument the
command will behave different rather different ways.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sfdisk: replace my_warn() with warnx()

This change adds program name in front of error messages.  Often that
helps user to know which command sent message, when the command is
executed as part of script.

Unfortunately the prefixing can break scripts, as someone might have
wrote automation which expects output in the format it has always been.
In programmer terms, the change has an ABI change, which some may find
annoying.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
dmesg: convert time format bitfield to enum

Foremost this commit makes time printing formats explicit.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
dmesg: add --time-format option

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
dmesg: add iso-8601 time format

The ISO-8601 should be welcomed by anyone who tries to parse dmesg time
stamp, and compare them across servers.  Time format tries to imitate
coreutils 'date --iso-8601=ns' output, but instead of having nanoseconds
the dmesg is using microseconds.

Reference: http://www.cs.tut.fi/~jkorpela/iso8601.html
Addresses: http://xkcd.com/1179/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
docs: add --time-format option and ISO-8601 format to manual

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
dmesg: regroup time related options close to each other

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sd-daemon: update files taken from systemd project

Update sd-damoen.[hc] files from systemd upstream, using commit
fa3868c6d317b88715c55422b898f9070afe6575 as the sync point.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
hexdump: remove unnecessary global variables

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sfdisk: clean up unhide code

Signed-off-by: Karel Zak <kzak@redhat.com>
dmesg: fix --human color initialization

Signed-off-by: Karel Zak <kzak@redhat.com>
dmesg: define is_timefmt() macro only once

Signed-off-by: Karel Zak <kzak@redhat.com>
exec_shell: add a license and touch up func def

When this file was created, the standard license header was missed.
Add it using the same one from unshare.c.

The noreturn attribute is not needed since we include the header
which has it on the prototype.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
ul: enhance command performance

Avoid reseting, time after time, the memory which was not used.  Effect
of the change is below in before and after timings.

$ time ./ul </etc/services >/dev/null
real    0m0.320s
user    0m0.307s
sys     0m0.010s

$ time ./ul </etc/services >/dev/null
real    0m0.068s
user    0m0.050s
sys     0m0.017s

[kzak@redhat.com: - add "else" and use maxcol]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
sfdisk: fix typo

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>