getty: shrink help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
getty,login: tighten up handling of ctty, pgrp, and tty attr restoring on timeout

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
getty: remove now not needed resetting of ALRM to to SIG_DFL

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
remove duplicate include <sys/swap.h>

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
getty: add O_NONBLOCK to open which is used to drop ctty

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
getty: reset tty attrs on Ctrl-C and Ctrl-D too

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
getty: fix a minor problem of Ctrl-D not printing '\n'

Also removed defines for control chars which are never changed,
and added login/getty README.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb.h: remove unused defines

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb: split decode_base64 off read_base64

function                                             old     new   delta
decode_base64                                          -     182    +182
read_base64                                          378     255    -123
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 182/-123)           Total: 59 bytes

Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
whitespace fixes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb: shrink base64 decoding a bit

function                                             old     new   delta
bb_uuenc_tbl_base64                                   67      66      -1
decode_base64                                        182     161     -21

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
syslogd: work around rename() not renaming hardlinks to themselves

Function log_locally() within the syslogd can potentially lock up when
restarting the daemon after a power loss in case the unplanned shutdown hit the
rename operation during logfile rotation.

While POSIX requires the rename operation to be atomic, many file systems such
as JFFS2 implement the rename operation in 2 steps by linking the new name
followed by unlinking the original name. In case of a power loss during the
rename the system can end up with /var/log/messages and /var/log/messages.0
being 2 hard links to the same file.

When the syslog daemon restarts in such a situation it will rediscover the need
to rotate the log files, however, POSIX also requires that rename does nothing
and reports success in case oldpath and newpath are existing hard links to the
same file. Looping through reopen: by (O_CREAT | O_APPEND), the daemon
eternally reopens the same file without succeeding to rotate.

Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
makemime: fix -a option not taking parameter

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
getty: Hurd has no CBAUD, work around that

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
modinfo: make it select PLATFORM_LINUX. Closes 4411

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
bzcat: fix unpacking of more than one file, and unpacking of zero-size bz2. Closes 4393

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
testsuite: fix the mishap in the previous commit

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
testsuite: merge bzcat2.tests into bzcat.tests

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
cttyhack: print detected ctty name when called without parameters

Sometimes there's a need to figure out the controlling tty from a shell
script, for example, to obtain a line for getty. In this case it's easier
to call cttyhack than trying to repeat some of the cttyhack's logic.

function                                             old     new   delta
cttyhack_main                                        283     327     +44
packed_usage                                       28911   28915      +4

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
cttyhack: move /sys/class/tty/console/active check to the front

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>