summaryrefslogtreecommitdiffstats
path: root/term-utils
Commit message (Collapse)AuthorAgeFilesLines
* include/carefulputc: cleanup and add fputs_{quoted,nonblank}()Karel Zak2014-04-032-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* scriptreplay: no need to skip first time value or last bytes fixes #58Wolfgang Richter2014-03-201-4/+1Star
|
* script: time from end of read() call partially fixes #58Wolfgang Richter2014-03-201-2/+3
|
* script: clean up files usageKarel Zak2014-02-211-28/+40
| | | | | | | | | | | | | | | * don't initialize timingfd (to stderr) when -t not specified * care about timingfd dooutput() rather in main() * make timingdf gloval like fscript FILE * close all in done() * close irrelevant things in subshell and input processes Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* script: Also flush writes to timing file.Jesper Dahl Nyerup2014-02-211-1/+4
| | | | | | | | | If both -f and -t are given, flush the timing fd on each write, similar to the behavior on the script fd. This allows playback of still-running sessions, and reduces the risk of ending up with empty timing files when script(1) exits abnormally. Signed-off-by: Jesper Dahl Nyerup <nyerup@one.com>
* scriptreplay: Add --maxdelay option.Jesper Dahl Nyerup2014-02-102-4/+20
| | | | | | | | This option caps the delay between updates, to avoid long pauses in transcript playback. Signed-off-by: Jesper Dahl Nyerup <nyerup@one.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include/c.h: prefer nanosleep() over usleep()Karel Zak2014-01-241-1/+1
| | | | | | | | | | | | | | Let's use nanosleep() although if usleep() exists. The nanosleep function does no interact with signals and other timers. The patch introduces xusleep() as replacement to libc (or our fallback) usleep(). Yes, we don't want to use struct timespec + nanosleep() everywhere in code as nano-time resolution is useless for us. The patch also enlarges delays in some busy wait loops. It seems enough to try read/write 4x per second. Signed-off-by: Karel Zak <kzak@redhat.com>
* script: use all-io.h to make the code more robustKarel Zak2014-01-161-9/+5Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* script: fix inconsistent -q, use poll() rather then O_NONBLOCKKarel Zak2014-01-161-25/+17Star
| | | | | | | | | - don't suppress "Script done" message in typescript file by -q (note that -q has no effect to "Script started" message) - simplify the code by poll() Signed-off-by: Karel Zak <kzak@redhat.com>
* script: don't wait for empty descriptors if child is deadKarel Zak2014-01-161-4/+8
| | | | | | | | The current code waits for empty file master and slave descriptors, but it makes sense only if there is child process that cares (read) about data in the descriptors. Signed-off-by: Karel Zak <kzak@redhat.com>
* script: script input redirection / eof handlingKarel Zak2013-12-031-19/+79
| | | | | | | | | | | | | | | | | | | | | | | echo "ps uf" | script does not work because script assume that stdin is terminal and it does not forward EOF to the pty. This patch: * make non-tty use-case more robust (don't call tty ioclts to non-tty file descriptors. * send EOF (CTL('D') control char) to the master channel when detected eof by read() on stdin * wait for empty master and slave file descriptors to be sure that we don't miss date for typescript. This is also necessary to be sure that slave channel (shell) is completely initialized otherwise EOF is ignored. Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* script: check that stdin is a terminalKarel Zak2013-12-021-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setterm: fix -dump man page infoKarel Zak2013-12-021-1/+1
| | | | | | | | | It seems that setterm -dump does not dump terminal attributes, but the man page says -dump includes the attributes. Let's fix the man page. Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: support the special terminal on first serial line on a S/390Werner Fink2013-12-021-0/+18
| | | | | | | | which is due legacy reasons a block terminal of type 3270 or higher. Whereas the second serial line on a S/390(x) is a real character terminal which is compatible with VT220. Signed-off-by: Werner Fink <werner@suse.de>
* losetup, agetty: remove unnecessary if's before free()Sami Kerola2013-12-021-4/+2Star
| | | | | Reference: http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/useless-if-before-free Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* script: restore errno in signal handlerKarel Zak2013-11-141-0/+3
| | | | | References: https://plus.google.com/+LennartPoetteringTheOneAndOnly/posts/gHSscCJkakd Signed-off-by: Karel Zak <kzak@redhat.com>
* script: don't call TIOCGWINSZ in signal handlerKarel Zak2013-11-141-3/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: standardize the phrases for --help and --version in all man pagesBenno Schulenberg2013-10-154-7/+7
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* docs: format, grammarize, and standardize the wall man pageBenno Schulenberg2013-10-151-19/+21
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* various: fix mixing declarations and code compiler warnings [smatch]Sami Kerola2013-10-081-5/+5
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: make two messages somewhat easier to understandBenno Schulenberg2013-10-081-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* build-sys: use tinfo *or* ncurses for more(1), ul(1) and setterm(1)Karel Zak2013-10-041-2/+9
| | | | | | | | | | | | * it seems that we don't have to link the utils with ncurses, tinfo is enough. This change saves one unnecessary dependence. * libtinfo is also distributed with pkg-config files, so we can use PKG_CHECK_MODULES() as a primary source for LIBS and CFLAGS. * add TINFO_CFLAGS (although it's probably always empty) Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: tweak the grammar of an agetty man-page fragmentBenno Schulenberg2013-10-041-4/+4
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* agetty: use standard angular brackets in usage messageBenno Schulenberg2013-10-041-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* build-sys: Fix check for __GNU_LIBRARY__Michael Forney2013-10-041-1/+1
| | | | | | | If we are not on glibc, __GNU_LIBRARY__ will not exist causing the check to always fail and try to use syscalls directly. Signed-off-by: Karel Zak <kzak@redhat.com>
* include: Add missing includesMichael Forney2013-10-041-0/+1
| | | | | | | | sys/types.h: For u_char typedef sys/params.h: For MAXNAMLEN sys/ttydefaults.h: For various tty definitions (also add configure check) Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'master' of https://github.com/yurchor/util-linuxKarel Zak2013-09-301-1/+1
|\
| * Fix various typosYuri Chornoivan2013-09-281-2/+2
| |
* | textual: fix misspelled words in -rc1Karel Zak2013-09-301-1/+1
| | | | | | | | | | Reported-by: Rafael Ferreira <rafael.f.f1@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* | clean up term lib handlingMike Frysinger2013-09-301-5/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ncurses package has been providing pkg-config files for a while now. So let's start using them to get the proper linker & compiler flags. It can make a difference when ncurses is configured in a way that requires extra link time flags but util-linux doesn't provide them, or when the headers live in a weird place and util-linux can't find them. Since the NCURSES_LIBS is always defined for the Makefile, there's no need to gate on the HAVE_NCURSES conditional. When it's disabled, the var will simply be empty. With a minor tweak to how tinfo is handled, we can do the same thing -- we just always use TINFO_LIBS in the Makefile's. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | setterm: fix term.h/ncurses.h include orderingMike Frysinger2013-09-301-2/+3
|/ | | | | | | | | | | | | | | | | | | The ncurses term.h header has logic in it to detect if nucrses.h has already been included and void defining things when it has. But since setterm includes term.h and the ncurses.h, it doesn't work and we can get fun build-time warnings like: CC term-utils/setterm-setterm.o In file included from term-utils/setterm.c:109:0: /usr/include/ncursesw/ncurses.h:827:12: warning: redundant redeclaration of 'tigetflag' [-Wredundant-decls] extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); /* implemented */ ^ In file included from term-utils/setterm.c:106:0: /usr/include/ncursesw/term.h:775:12: note: previous declaration of 'tigetflag' was here extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); ^ Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* agetty: add \S to output /etc/os-release dataKarel Zak2013-09-122-2/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows to use a new \S or \S{VARNAME} sequence in the /etc/issue file. The sequence prints data from /etc/os-release. The reason is to keep /etc/issue file distribution and release independent. The \S{ANSI_COLOR} is converted to the real terminal escape seq. For example: \S Kernel \r on an \m (\l) or more complex example: Welcome to \S{ANSI_COLOR}\S{NAME}0m \S{VERSION} Report bugs at \S{BUG_REPORT_URL}. See http://www.freedesktop.org/software/systemd/man/os-release.html fr more details about /etc/issue. Based on patch from Bill Nottingham <notting@redhat.com>. Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: add baud rates available from glibc that are not already supportedJames Buren2013-09-121-0/+36
| | | | | This adds userspace support for baud rates reater than 230400, provided the tty also supports it.
* agetty: only use EXTA/EXTB macros if B19200/B38400 macros are not presentJames Buren2013-09-121-7/+5Star
|
* agetty: cleanup debug ifdefsKarel Zak2013-09-091-5/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* last, utmpdump, agetty, wall, write: avoid compatibility hacksSami Kerola2013-08-293-3/+7
| | | | | | | | In include/bits/utmp.h the ut_user and ut_time macros are marked with comment they are backwards compatibility hacks. It is probably best to avoid use of these macros where ever possible. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* write: change determination can user write to a terminalSami Kerola2013-08-291-4/+5
| | | | | | | | | | | | | Earlier test failed when user had write permission, but was not in special group that owns terminal devices, usually tty. This made write(1) to fail for root, if the root did not happen to be in tty group. In this commit root is granted ot write to anyone, even if they have mesg(1) turned off. For an user who is trying to write to own other session the group write bit is significant only for whether mesg(1) are enabled. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: add note to wall(1) about sessions which will not get messageSami Kerola2013-08-291-0/+6
| | | | | | | | | | | | Sessions that has in utmp data ut_line begining with ':' are skipped. This is done to avoid write errors to devices such as '/dev/:0'. For example wdm is reported to to generate such utmp line. Perhaps in future this code should be revalidated. If an utmp data contains broken device lines it might be best inform user with a error message, rather than skipping silently suspicious device entries. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* wall: line wrap at column 79 also when line has tab charsSami Kerola2013-08-291-0/+2
| | | | | | | Earlier tabs caused random ragged right indentation, because the tab length was assumed to be 1 char which is not the case most of the time. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mesg: sync usage() with howto-usage-function.txtSami Kerola2013-08-291-8/+7Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* wall: sync usage() with howto-usage-function.txtSami Kerola2013-08-291-11/+10Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* wall: send message also to sessions opened by user 'sleeper'Sami Kerola2013-08-291-4/+1Star
| | | | | | | Ignoring an user by name, and not telling about it in manual page, is unexpected. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include: carefulput: print determined char when unprintable char is foundSami Kerola2013-08-232-2/+2
| | | | | | This is done to allow reuse of the functin in last(1). Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* wall: make banner sysvinit compatibleKarel Zak2013-08-131-16/+18
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wall: allow to specify <message> on command lineKarel Zak2013-08-132-36/+68
| | | | | | | | | | wall(1) from sysvinit supports # wall I love this company! semantic, This patch add this functionally to the util-linux wall. Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: -L accepts optional argumentKarel Zak2013-08-061-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: fix memory leak [clang-analyzer]Sami Kerola2013-07-091-1/+3
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Fixes "getty: unrecognized option '--loginpause'"kernc2013-07-041-2/+2
| | | | | Usage incorrectly stated --loginpause is a valid option, where instead --login-pause is. Also --no-hostname --> --nohostname.
* agetty: improve wording, grammar and some formatting in man pageBenno Schulenberg2013-06-181-49/+49
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* agetty: fix a kill/erase error in man page and improve clarityBenno Schulenberg2013-06-181-12/+12
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>