agetty: update man page and usage()

 - baud_rate is optional
 - agetty has been rewritten 2 years ago, so don't blame original
   authors in the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
agetty: don't remove ECHOCTL from c_lflag

It's really unexpected that arrows keys move cursor when agetty/login
asks for login name or password.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=969458
Signed-off-by: Karel Zak <kzak@redhat.com>
login: use TCSANOW to remove HUPCL

Fedora 19, kernel 3.9, systemd 204, telnetd with socket activation.

login(1) code:

        ttt.c_cflag &= ~HUPCL;
        tcsetattr(0, TCSAFLUSH, &ttt);

        close(STDIN_FILENO);
        close(STDOUT_FILENO);
        close(STDERR_FILENO);

        signal(SIGHUP, SIG_IGN);        /* so vhangup() wont kill us */
        vhangup();
        signal(SIGHUP, SIG_DFL);

strace :

	ioctl(0, SNDCTL_TMR_CONTINUE or SNDRV_TIMER_IOCTL_GPARAMS or TCSETSF, {B9600 opost isig icanon echo ...}) = 0
	close(0)                                = 0
	close(1)                                = 0
	close(2)                                = 0
	--- SIGHUP {si_signo=SIGHUP, si_code=SI_KERNEL} ---
	--- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=1, si_uid=0} ---
	+++ killed by SIGTERM +++

It seems we get SIGHUP (and SIGTERM from systemd) before vhangup().
The problem occur sometimes.

I guess it's because TCSAFLUSH is not applied immediately, so it would
be probably better to use TCSANOW to make the code more robust.

References: https://bugzilla.redhat.com/show_bug.cgi?id=962145
Signed-off-by: Karel Zak <kzak@redhat.com>
runuser: update man page, add note about -l vs. -p

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
textual: standardize synopsis for login, and improve an error message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
textual: standardize the spelling of "superuser"

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
textual: tiny alphabetical and grammatical tweak

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
docs: improve grammar and consistency of comments in login.c

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
su: fix exit status if terminated by signal

[kzak@redhat.com: - add comment]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
mount: (deprecated) fix typo tailed->failed

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
textual: harmonize some loop-device error messages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
textual: fix several typos and angular brackets in messages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
docs: normalize the formatting of man pages for nsenter and unshare

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
docs: slightly correct the man page of column

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
lib: remove unused code

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lscpu: add max MHz value to make cpu governor effects more visible

The existing 'CPU MHz' is usually dynamic value, which CPU governor
changes up on needs of CPU demand.  Assuming lscpu is used to gather
information to a hardware inventory the dynamic value is misleading.  For
inventing the maximum MHz value is more sensible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
docs: add lscpu max mhz to manual and bash completion

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
rev: stop adding new line at the end when input does not have it

When the rev(1) is executed twice outcome is expected to be exactly what
it was originally.  That includes not adding new line at the end of the
output.  The oneliner below demonstrates earlier issue.

$ printf "abc\n123" | rev | rev

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
rev: simplify new line detection and impossible test

The new line detection is earlier using only '\n' so there should not be
need to search for '\r' later.

The detection whether allocated address is pointing to null seems to be
unnecessary.  Assuming xmalloc() returned valid address space the address
should never be 0.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
rev: reduce stream checking when closing read-only file descriptor

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