dmesg: move get_boot_time() to lib/timeutils

In future the last(1) will use get_boot_time() as well.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
last: fix is_phantom() detection

The /proc/<pid>/loginuid is not always available, and when so a running
session should not be determined to be gone.  This is a regression from
commit mentioned in reference.

Sessions that have started before previous system boot, and did not log
out meanwhile, will be marked as gone.  It is fair to say that these
sessions are most likely result of a wtmp corruption.

Reference: 404fa3f93c00c7e130f5a0ec963b2dc6a3743986
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
include/c.h: add macro to print definitions as string

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
mkswap, swaplabel: move version number to header

Corrently only the swap version 1 is supported, which is a magic value so
move it to header.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
mkswap: remove legacy swap structure

If software archeolgists want to know how the old, and unused, swap
header looked they can dig it from the revision history.

Reference: 4c85aa3a4c26f2a2c33bf16960b548d5bbd5b4bf
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
include/swapheader.h: ensure type sizes

Use consistently the same type sizes as in libblkid and kernel.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
swapon: swaps with legacy version label are not supported

Reviewed-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
swapon, swapheader, mkswap: move swap signature to header

Both swapon and mkswap need to know what is valid device signature, so
share the value.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
libsmartcols: remove ununsed assignment

Value stored to 'rc' is never read.

[Karel: but you should still check the value]

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lib/timeutils: fix memory leak

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lib/pager: use names when referring to standard file descriptors

Signed-off-by: Sami Kerola <kerolasa@iki.fi>