summaryrefslogtreecommitdiff
path: root/src/shared/time-util.c
AgeCommit message (Collapse)Author
2015-04-21core: make unit deserialization more defensiveLennart Poettering
2015-02-24shared/time-util: fix gcc5 warningDaniel Mack
CC src/shared/libsystemd_shared_la-time-util.lo src/shared/time-util.c: In function 'parse_nsec': src/shared/time-util.c:789:25: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] if (!*s != 0) ^
2015-02-03util: rework strappenda(), and rename it strjoina()Lennart Poettering
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.
2014-10-24time: don't do comparison twiceLennart Poettering
2014-10-24time: minor simplificationLennart Poettering
2014-10-24time: earlier exit from format_timestamp_relative() on special timesLennart Poettering
2014-10-24time: also support 'infinity' syntax in parse_nsec()Lennart Poettering
Let's make parse_usec() and parse_nsec() work similar
2014-10-08time: functions named "internal" really shouldn't be exportedLennart Poettering
Also, let's try to make function names descriptive, instead of using bools for flags.
2014-10-03journalctl: make --utc work everywhereJan Synacek
The --utc option was introduced by commit 9fd290443f5f99fca0dcd4216b1de70f7d3b8db1. Howerver, the implementation was incomplete.
2014-09-29Do not format USEC_INFINITY as NULLZbigniew Jędrzejewski-Szmek
systemctl would print 'CPUQuotaPerSecUSec=(null)' for no limit. This does not look right. Since USEC_INFINITY is one of the valid values, format_timespan() could return NULL, and we should wrap every use of it in strna() or similar. But most callers didn't do that, and it seems more robust to return a string ("infinity") that makes sense most of the time, even if in some places the result will not be grammatically correct.
2014-07-29time-util: add and use USEC/NSEC_INFINIYKay Sievers
2014-07-24time-util: add clock_boottime_or_monotonicTom Gundersen
CLOCK_BOOTTIME is not supported by timerfd on older kernels, so for the time beeing, use this helper instead which will fallback to CLOCK_MONOTONIC if CLOCK_BOOTTIME is not supported.
2014-07-07shared: make timezone and locale enumeration and validation genericLennart Poettering
This way we can reuse it other code thatn just localectl/localed + timedatectl/timedated.
2014-05-22time-util: make sure USEC_PER_SEC and friends are actually of type usec_tLennart Poettering
2014-05-15Remove unnecessary casts in printfsZbigniew Jędrzejewski-Szmek
No functional change expected :)
2014-03-25time: support @ syntax for denoting times since the UNIX epoch 1970-1-1Lennart Poettering
2013-12-20logging: reduce send timeout to something more sensibleZbigniew Jędrzejewski-Szmek
For a user, the timeout of 1 min per message seems equivalent to a hang. If journald cannot process a message from PID1 for 10 ms then something is significantly wrong. It's better to lose the message and continue.
2013-12-15Fix a few signed/unsigned format string issuesZbigniew Jędrzejewski-Szmek
Since numbers involved are all small, behaviour was correct already. https://bugzilla.redhat.com/show_bug.cgi?id=1043304
2013-11-11timer: consider (usec_t) -1 an invalid timestampLennart Poettering
2013-11-11timer: properly format relative timestamps in the futureLennart Poettering
2013-10-21silent a few more gcc warningsKay Sievers
2013-10-17timedated: expose time and NTP sync flag via the busLennart Poettering
This way, timedatectl can be run over the network and determine all properties correctly from the server rather than the client.
2013-08-20logs-show: add short-precise mode with us timestampsZbigniew Jędrzejewski-Szmek
Also, always show us timestamps in verbose mode. https://bugzilla.redhat.com/show_bug.cgi?id=991678
2013-04-04util: tweak format_timespan() a bitLennart Poettering
Make sure to always print out at least one valid component instead of falling back early to 0.
2013-04-04util: make time formatting a bit smarterLennart Poettering
Instead of outputting "5h 55s 50ms 3us" we'll now output "5h 55.050003s". Also, while outputting the accuracy is configurable. Basically we now try use "dot notation" for all time values > 1min. For >= 1s we use 's' as unit, otherwise for >= 1ms we use 'ms' as unit, and finally 'us'. This should give reasonably values in most cases.
2013-04-03time: add suppot for fractional time specificationsLennart Poettering
We can now parse "0.5s" as the same as "500ms". In fact, we can parse "3.45years" correctly, too, and any other unit and fraction length.
2013-04-03util: rename parse_usec() to parse_sec() sinds the default unit is secondsLennart Poettering
Internally we store all time values in usec_t, however parse_usec() actually was used mostly to parse values in seconds (unless explicit units were specified to define a different unit). Hence, be clear about this and name the function about what we pass into it, not what we get out of it.
2013-03-29Always use errno > 0 to help gccZbigniew Jędrzejewski-Szmek
gcc thinks that errno might be negative, and functions could return something positive on error (-errno). Should not matter in practice, but makes an -O4 build much quieter.
2013-01-10dbus: properly serialize calendar timer dataLennart Poettering
As it turns out the bus properties for timer units wre really broken, so let's clean this up for good and properly add calendar timer serialization. We really should get that right before finalizing the bus API documentation in the wiki...
2013-01-08core: properly initialize kernel timestampLennart Poettering
2012-11-23time-util: teach parse_timestamp to parse weekdaysLennart Poettering
2012-11-23path-util: when parsing a timestamp we don't know the timezoneLennart Poettering
2012-11-23util: teach parse_timestamp() to parse results of format_timestamp_relative()Lennart Poettering
2012-11-23util: rename format_timestamp_pretty() to format_timestamp_relative() ↵Lennart Poettering
because that describes much better what it does
2012-11-23util: split off time related calls from util.[ch] into time-util.[ch]Lennart Poettering