zramctl: fixed two -Wformat-security warnings

(they prevented compilation if -Werror=format-security is enabled)

Signed-off-by: Steven Honeyman <stevenhoneyman@users.noreply.github.com>
lib/blkdev: report correct disk size on GNU/kFreeBSD. Thanks Tuco.

Addresses-Debian-Bug: 592292
ipcs: remaining kFreeBSD hackery for building.

Addresses-Debian-Bug: #527384
Signed-off-by: LaMont Jones <lamont@debian.org>
agetty: fixing FTBFS on !linux (Debian util-linux 2.20.1-1.2)

Handle vc flags missing on FreeBSD
Fix tty creation on kFreeBSD taking patch from 2.19

Addresses-Debian-Bug: #650185
ipcrm: add hacks to avoid FTBFS

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
build-sys: use -lutil for BSD only

Signed-off-by: Karel Zak <kzak@redhat.com>
Merge branch 'master' of https://github.com/stevenhoneyman/util-linux
libuuid: add extern qualifiers to uuid/uuid.h system header

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
include: simplify fputc_careful() in carefulputc.h

New version of comparisions does the same thing as the old without being
quite as difficult to understand.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lib: remove xgetpass()

This function is not in use, and it has reference to obsoleted getpass().

Reference: http://man7.org/linux/man-pages/man3/getpass.3.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
last: make is_phantom() when kernel config does not include audit support

When kernel CONFIG_AUDIT is not set the /proc/<pid>/loginuid information
is not present resulting live sessions to be marked 'gone - no logout' in
last(1) print out.  To go-around this change makes last(1) to look
/dev/<tty> device ownership as a substitute of loginuid.

The go-around seems to work fairly well, but it has it short comings.
For example after closing a X window session the /dev/ttyN file seems to
be owned by root, not the user who had it before entering to the X
session.  While that is suboptimal it is still better than an attmempt to
determine uid_t by looking owner of the /proc/<struct utmp ut_pid>, that
is a login(1) process running as root.

The issue was found using Archlinux installation.

$ pacman -Qi linux
Name           : linux
Version        : 3.16-2
[...]
Build Date     : Mon Aug 4 18:06:51 2014

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
last: improve code readability by renaming variable names

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
mountpoint: add struct mountpoint_control

This unifies variable names in different functions, and removes redundant
stat() calls.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
mkfs.minix: fix couple compiler warnings

disk-utils/mkfs.minix.c:366:3: warning: ISO C forbids 'return' with
expression, in function returning void [-Wpedantic]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
mountpoint: simplify if statement

Returning straight after print_devno() makes the code to be more obvious
and removes need for long else statement.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
eject: add struct eject_control to remove global variables

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
eject: make open_device() and select_speed() to use struct eject_control

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
hwclock: remove referal to deprecated keyboard interface

The KDGHWCLK has been gone quite a while.

Reference: http://marc.info/?l=linux-kernel&m=104171103925897
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setarch: reindent code

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setarch: use personality() system call when it is available

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