summaryrefslogtreecommitdiffstats
path: root/src/timedate (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #20138 from keszybz/coding-style-variable-declsLuca Boccassi2021-11-051-1/+1
|\ | | | | A coding style tweak and checking of sd_notify() calls and voidification of pager_open()
| * Make pager_open() return voidZbigniew Jędrzejewski-Szmek2021-11-031-1/+1
| |
* | tree-wide: do not print hint about -M if -M is already usedZbigniew Jędrzejewski-Szmek2021-11-041-1/+1
|/ | | | | | | | (Or when -H is used, since -H and -M are incompatible.) Note that the slightly unusual form with separate boolean variables (hint_vars, hint_addr) instead of e.g. a const char* variable to hold the message, because this way we don't trigger the warning about non-literal format.
* alloc-util: add strdupa_safe() + strndupa_safe() and use it everywhereLennart Poettering2021-10-141-1/+1
| | | | | | | | | | | | | Let's define two helpers strdupa_safe() + strndupa_safe() which do the same as their non-safe counterparts, except that they abort if called with allocations larger than ALLOCA_MAX. This should ensure that all our alloca() based allocations are subject to this limit. afaics glibc offers three alloca() based APIs: alloca() itself, strndupa() + strdupa(). With this we have now replacements for all of them, that take the limit into account.
* Drop the text argument from assert_not_reached()Zbigniew Jędrzejewski-Szmek2021-08-031-1/+1
| | | | | | | | | | | | | | | | | In general we almost never hit those asserts in production code, so users see them very rarely, if ever. But either way, we just need something that users can pass to the developers. We have quite a few of those asserts, and some have fairly nice messages, but many are like "WTF?" or "???" or "unexpected something". The error that is printed includes the file location, and function name. In almost all functions there's at most one assert, so the function name alone is enough to identify the failure for a developer. So we don't get much extra from the message, and we might just as well drop them. Dropping them makes our code a tiny bit smaller, and most importantly, improves development experience by making it easy to insert such an assert in the code without thinking how to phrase the argument.
* tree-wide: add FORMAT_TIMESPAN()Zbigniew Jędrzejewski-Szmek2021-07-091-18/+12
|
* tree-wide: use FORMAT_TIMESTAMP()Zbigniew Jędrzejewski-Szmek2021-07-091-9/+5
|
* timedated: make ntp_synced() staticZbigniew Jędrzejewski-Szmek2021-05-121-0/+13
| | | | No need to have this in basic.
* bus-print-property: introduce BusPrintPropertyFlagsYu Watanabe2021-04-281-13/+9
| | | | Follow-ups for 1ceaad69378272c64da4ecaab0d59ebb7a92ca0a.
* timedate: make log_unit_xxx_errno() refuse zero errnoYu Watanabe2021-04-161-15/+24
|
* Merge pull request #19243 from bluca/lgtmZbigniew Jędrzejewski-Szmek2021-04-091-1/+2
|\ | | | | Fix various issues reported by LGTM
| * timedated: use format_timestamp instead of ctimeLuca Boccassi2021-04-081-1/+2
| | | | | | | | | | | | Some static analyzers (lgtm) warn against using non-re-entrant functions, even though at the moment this code is not multi-threaded, just switch to format_timestamp.
* | timedatectl: rework handling of conditions in print_status_info()Zbigniew Jędrzejewski-Szmek2021-04-081-16/+9
|/ | | | | | gcc-11.0.1-0.3.fc34.x86_64 was complaining that n might be unset with --optimization=1. It was wrong, but let's rework the code to make it obvious that it is always set.
* timedated: fix skipping of comments in config fileZbigniew Jędrzejewski-Szmek2021-03-091-1/+1
| | | | | | | | Reading file '/usr/lib/systemd/ntp-units.d/80-systemd-timesync.list' Failed to add NTP service "# This file is part of systemd.", ignoring: Invalid argument Failed to add NTP service "# See systemd-timedated.service(8) for more information.", ignoring: Invalid argument :(
* timedate: do not ignore fix_system argument in SetLocalRTC methodYu Watanabe2021-02-241-7/+9
| | | | Fixes #18391.
* tree-wide: enable colorized logging for daemons when run in consoleYu Watanabe2021-01-312-2/+2
| | | | It may be useful when debugging daemons.
* tree-wide: Drop custom formatting for print() help messagesDaan De Meyer2021-01-311-6/+5
| | | | | | | | | | | | I think this formatting was originally used because it simplified adding new options to the help messages. However, these days, most tools their help message end with "\nSee the %s for details.\n" so the final line almost never has to be edited which eliminates the benefit of the custom formatting used for printf() help messages. Let's make things more consistent and use the same formatting for printf() help messages that we use everywhere else. Prompted by https://github.com/systemd/systemd/pull/18355#discussion_r567241580
* timedate: actually reset system time with new timezoneYu Watanabe2021-01-121-1/+1
| | | | | | Fix a bug introduced by 56b0ef2fc283425df6ae6f1dc198e0c408f70471. Closes CID#1436943.
* timedate: use localtime_or_gmtime_r() and mktime_or_timegm()Yu Watanabe2020-11-201-16/+4
|
* basic/env-util: add little helper to call setenv or unsetenvZbigniew Jędrzejewski-Szmek2020-11-101-5/+3
|
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-096-6/+6
|
* Replace gendered pronouns with gender neutral ones. (#16844)PhoenixDiscord2020-08-271-1/+1
|
* Merge pull request #16624 from keszybz/timesync-retry-intervalZbigniew Jędrzejewski-Szmek2020-07-301-1/+1
|\ | | | | Make timesyncd retry interval grow more slowly
| * timedatectl: do not show (null) if the address of NTP server is not resolvedYu Watanabe2020-07-161-1/+1
| |
* | bus: use bus_log_connect_error to print error messagefangxiuning2020-07-211-1/+1
|/
* bus: use bus_log_parse_error to print messagefangxiuning2020-07-111-1/+1
|
* table use table_log_print_error() instead of table_log_show_errorfangxiuning2020-07-081-4/+4
|
* table add table_log_show_error()fangxiuning2020-07-081-4/+4
|
* shared: split out property get helpersLennart Poettering2020-06-301-0/+1
| | | | No code changes, just some refactoring.
* shared: split out code for printing propertiesLennart Poettering2020-06-301-0/+1
| | | | No code changes, just some refactoring.
* shared: split out code that maps properties to local structsLennart Poettering2020-06-302-0/+2
| | | | Just some refactoring, no code changes.
* shared: actually move all BusLocator related calls to bus-locator.cLennart Poettering2020-06-302-3/+3
|
* log: introduce log_parse_environment_cli() and log_setup_cli()Filipe Brandenburger2020-06-241-3/+1
| | | | | | | | | | | | | | | | Presently, CLI utilities such as systemctl will check whether they have a tty attached or not to decide whether to parse /proc/cmdline or EFI variable SystemdOptions looking for systemd.log_* entries. But this check will be misleading if these tools are being launched by a daemon, such as a monitoring daemon or automation service that runs in background. Make log handling of CLI tools uniform by never checking /proc/cmdline or EFI variables to determine the logging level. Furthermore, introduce a new log_setup_cli() shortcut to set up common options used by most command-line utilities.
* Make failures of mac_selinux_init() fatalChristian Göttsche2020-06-231-1/+4
|
* macro: introduce DISABLE_WARNING_TYPE_LIMITS and make use of it everywhereLennart Poettering2020-05-251-3/+2
|
* timedate: switch to BusLocator-oriented helpersVito Caputo2020-05-072-90/+29
| | | | Mechanical substitution reducing some verbosity
* timedated: convert to the new scheme and add --bus-introspectZbigniew Jędrzejewski-Szmek2020-05-051-3/+11
|
* importd,logind: add --bus-introspect= optionZbigniew Jędrzejewski-Szmek2020-05-051-0/+1
|
* logind,importd,hostnamed,localed,timedated,machined,resolved: add option ↵Zbigniew Jędrzejewski-Szmek2020-05-031-3/+7
| | | | | | | | parsing stubs --help and --version are implemented in the usual style. help() prints full path, since the program is not expected to be in $PATH.
* tree-wide: implement new log control API dbus interface in all our daemonsLennart Poettering2020-04-211-0/+5
|
* timedated: add dbus parameter namesZbigniew Jędrzejewski-Szmek2020-04-121-5/+39
|
* shared: split out polkit stuff from bus-util.c → bus-polkit.cLennart Poettering2020-01-221-1/+1
| | | | | | It's enough, complex stuff to warrant its own source file. No other changes, just splitting out.
* Merge pull request #14381 from keszybz/ifindex-cleanupLennart Poettering2020-01-131-13/+12
|\ | | | | Resolve alternative names
| * timedatectl: drop ifindex output parameter tooZbigniew Jędrzejewski-Szmek2020-01-111-15/+11
| |
| * tree-wide: make parse_ifindex simply return the indexZbigniew Jędrzejewski-Szmek2020-01-111-2/+5
| | | | | | | | | | | | | | | | We don't need a seperate output parameter that is of type int. glibc() says that the type is "unsigned", but the kernel thinks it's "int". And the "alternative names" interface also uses ints. So let's standarize on ints, since it's clearly not realisitic to have interface numbers in the upper half of unsigned int range.
* | tree-wide: use table_log_add_error()Yu Watanabe2020-01-101-22/+22
|/
* timedatectl: use format-table.[ch]Yu Watanabe2020-01-091-59/+187
|
* tree-wide: clean up --help texts a bitLennart Poettering2019-11-181-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleans up and unifies the outut of --help texts a bit: 1. Highlight the human friendly description string, not the command line via ANSI sequences. Previously both this description string and the brief command line summary was marked with the same ANSI highlight sequence, but given we auto-page to less and less does not honour multi-line highlights only the command line summary was affectively highlighted. Rationale: for highlighting the description instead of the command line: the command line summary is relatively boring, and mostly the same for out tools, the description on the other hand is pregnant, important and captions the whole thing and hence deserves highlighting. 2. Always suffix "Options" with ":" in the help text 3. Rename "Flags" → "Options" in one case 4. Move commands to the top in a few cases 5. add coloring to many more help pages 6. Unify on COMMAND instead of {COMMAND} in the command line summary. Some tools did it one way, others the other way. I am not sure what precisely {} is supposed to mean, that uppercasing doesn't, hence let's simplify and stick to the {}-less syntax And minor other tweaks.
* Merge pull request #14010 from poettering/localtime-symlinkLennart Poettering2019-11-131-10/+25
|\ | | | | tweaks to /etc/localtime management
| * timedated: it might be that tzinfo files are just not installedLennart Poettering2019-11-131-1/+1
| |