summaryrefslogtreecommitdiff
path: root/src/shared/pager.c
Commit message (Collapse)AuthorAge
* fix parenthesis in pager.c (#5798)Matija Skala2017-07-25
| | | | | - result of dup2 should be compared against 0 - making parenthesis around comparisons just to be sure
* redirect stdout/stderr back when closing the pager (#5661)Matija Skala2017-07-25
|
* assigning stdout and stderr is not allowedMatija Skala2017-07-25
|
* shared/pager: abort if we cannot set environment variablesZbigniew Jędrzejewski-Szmek2017-07-17
| | | | | | | This most likely means oom, it's better to exit than to run less with incomplete settings. CID #714383.
* copy: change the various copy_xyz() calls to take a unified flags parameterLennart Poettering2017-07-17
| | | | | | | | This adds a unified "copy_flags" parameter to all copy_xyz() function calls, replacing the various boolean flags so far used. This should make many invocations more readable as it is clear what behaviour is precisely requested. This also prepares ground for adding support for more modes later on.
* pager: tiny beautificationLennart Poettering2017-07-05
|
* Prep v231.2: Make elogind musl-libc-compatible again.Sven Eden2017-06-19
|
* pager: don't start pager if the terminal is explicitly set to TERM=dumbLennart Poettering2017-06-16
| | | | | | | | | As suggested here: https://bugs.freedesktop.org/show_bug.cgi?id=64737#c8 This adds a new call terminal_is_dumb() and makes use of this where appropriate.
* Prep v230: Apply missing upstream fixes and updates (7/8) src/shared.Sven Eden2017-06-16
|
* tree-wide: merge pager_open_if_enabled() to the pager_open()Alexander Kuleshov2017-06-16
| | | | | | | | | Many subsystems define own pager_open_if_enabled() function which checks '--no-pager' command line argument and open pager depends on its value. All implementations of pager_open_if_enabled() are the same. Let's merger this function with pager_open() from the shared/pager.c and remove pager_open_if_enabled() from all subsytems to prevent code duplication.
* Prep v229: Add missing fixes from upstream [5/6] src/sharedSven Eden2017-05-17
|
* Prep v228: Condense elogind source masks (5/5)Sven Eden2017-04-26
|
* Prep v228: Add remaining updates from upstream (3/3)Sven Eden2017-04-26
| | | | | Apply remaining fixes and the performed move of utility functions into their own foo-util.[hc] files on the rest of elogind.
* do not change stderr/stdout variables.Enno Boland2017-04-26
| | | | | musl for example marks those variables as const and therefore fails while building at this file.
* [5/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* pager: set $LESSCHARSET when we output UTF8 charsLennart Poettering2017-03-29
| | | | | | | | | This way we can be sure that less has the same idea of the terminal as we do. This solves issues in systems that have locale uninitalized, where elogind would output UTF-8 but less wouldn't allow it and show them as control characters.
* pager: also redirect stderrLennart Poettering2017-03-29
| | | | | | It's really confusing if stdout goes to the pager, but stderr is written directly to the screen. Hence, make sure both stdout and stderr are passed to the pager when doing autopaging.
* Add support for building elogind against musl libcSven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | * Check whether printf.h is available and define/undef HAVE_PRINTF_H accordingly. * Added src/shared/parse-printf-format.[hc] by Emil Renner Berthing <systemd@esmil.dk> that provides parse_printf_format() if printf.h is unavailable * Added src/basic/musl_missing.h by Juergen Buchmueller <pullmoll@t-online.de> that implements glibc functions missing in musl libc as macros. * Extended src/basic/musl_missing.h and added src/basic/musl_missing.c providing - program_invocation_name - program_invocation_short_name and - elogind_set_program_name() to set the two where appropriate. * Added calls to elogind_set_program_name() to all main() functions where needed. * A few other fixes to work nicely with musl libc.
* pager: set $LESSCHARSET when we output UTF8 charsLennart Poettering2017-03-14
| | | | | | | | | This way we can be sure that less has the same idea of the terminal as we do. This solves issues in systems that have locale uninitalized, where systemd would output UTF-8 but less wouldn't allow it and show them as control characters.
* pager: also redirect stderrLennart Poettering2017-03-14
| | | | | | It's really confusing if stdout goes to the pager, but stderr is written directly to the screen. Hence, make sure both stdout and stderr are passed to the pager when doing autopaging.
* pager: port fallback pager to use copy_bytes()Lennart Poettering2017-03-14
|
* Prep v221: Update and clean up build system to sync with upstreamSven Eden2017-03-14
| | | | | | | | | | | | | | This commit replays the moving around of source files that have been done between systemd-219 and systemd-221. Further the Makefile.am is synchronized with the upstream version and then "re-cleaned". A lot of functions, that are not used anywhere in elogind have been coated into #if 0/#endif directives to further shorten the list of dependencies. All unneeded files have been removed.
* tree-wide: whenever we fork off a foreign child process reset signal ↵Lennart Poettering2017-03-14
| | | | | | | | | | mask/handlers Also, when the child is potentially long-running make sure to set a death signal. Also, ignore the result of the reset operations explicitly by casting them to (void).
* shared: add terminal-util.[ch]Ronny Chevalier2017-03-14
|
* shared: add process-util.[ch]Ronny Chevalier2017-03-14
|
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-03
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* treewide: another round of simplificationsMichal Schmidt2014-11-28
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* shared: explicitly ignore the return value of wait_for_terminateRonny Chevalier2014-11-10
| | | | | | CID#1237532 CID#1237523 CID#1237522
* systemd-verify: check man pagesZbigniew Jędrzejewski-Szmek2014-07-20
|
* util: replace close_pipe() with new safe_close_pair()Lennart Poettering2014-03-24
| | | | | | safe_close_pair() is more like safe_close(), except that it handles pairs of fds, and doesn't make and misleading allusion, as it works similarly well for socketpairs() as for pipe()s...
* pager: support SYSTEMD_LESS environment variableJason A. Donenfeld2014-02-12
| | | | | | This allows customization of the arguments used by less. The main motivation is that some folks might not like having --no-init on every invocation of less.
* _noreturn_ --> noreturn for C11 compatShawn Landden2013-12-17
| | | | also define noreturn w/o <stdnoreturn.h>
* polkit: don't spawn local client if we access a remote systemLennart Poettering2013-11-07
|
* pager: add -M to $LESS to make the bottom line nicerLennart Poettering2013-03-07
|
* pager: always override LESSLennart Poettering2013-03-07
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=868383 Primary reason to do this is to ensure "-e" works as intended, and is not ignored because the user set his own LESS variable.
* pager: introduce "jump to end" optionHarald Hoyer2013-03-07
| | | | | | | | $ journalctl -be is what you want :) https://bugzilla.redhat.com/show_bug.cgi?id=867841
* pager: add K to less environmentLukas Nykryn2013-03-01
| | | | | | | | | Using less as a pager sometimes breaks terminal when output is interrupted by ctrl-c. Reproducer: run 'sudo journalctl' ctrl-c. Thanks mbriza@redhat.com for the solution.
* util: unify usage of on_tty() in util.cLennart Poettering2012-10-19
|
* journalctl: unify ellipsation handling between journalctl and systemctlLennart Poettering2012-10-18
|
* journalctl: fix ellipsization with PAGER=catZbigniew Jedrzejewski-Szmek2012-07-23
| | | | | | | | | | There are other reasons for not opening the pager then the --no-pager or --follow options (described below). If the pager is not used, messages must be ellipsized. On Fri, Jul 20, 2012 at 05:42:44AM +0000, Shawn Landen wrote: > "Pager to use when --no-pager is not given; overrides $PAGER. > Setting this to an empty string or the value cat is equivalent to passing --no-pager."
* relicense to LGPLv2.1 (with exceptions)Lennart Poettering2012-04-12
| | | | | | | | | | | | | | We finally got the OK from all contributors with non-trivial commits to relicense systemd from GPL2+ to LGPL2.1+. Some udev bits continue to be GPL2+ for now, but we are looking into relicensing them too, to allow free copy/paste of all code within systemd. The bits that used to be MIT continue to be MIT. The big benefit of the relicensing is that closed source code may now link against libsystemd-login.so and friends.
* move pager.[ch] to shared/Kay Sievers2012-04-10