eb3da9012f462da2451edeb8d67c5b67c833a0b1 |
|
13-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: optionally, when writing a string to a file, verify string on failure
With this change, the idiom:
r = write_string_file(p, buf, 0);
if (r < 0) {
if (verify_one_line_file(p, buf) > 0)
r = 0;
}
gets reduced to:
r = write_string_file(p, buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE);
i.e. when writing the string fails and the new flag
WRITE_STRING_FILE_VERIFY_ON_FAILURE is specified we'll not return a
failure immediately, but check the contents of the file. If it matches
what we wanted to write we suppress the error and exit cleanly. |
33d52ab92f2f0bfd706e6f343d172618d1e03f3d |
|
12-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
journald: rework --sync/--rotate logic to use CLOCK_MONOTONIC timestamp files
Previously, we'd rely on the mtime timestamps of the touch files to see
if our sync/rotation requests were already suppressed. This means we
rely on CLOCK_REALTIME timestamps. With this patch we instead store the
CLOCK_MONOTONIC timestamp *in* the touch files, and avoid relying on
mtime.
This should make things more reliable when the clock or underlying mtime
granularity is not very good.
This also adds warning messages if writing any of the flag files fails. |
c4cd1d4d93e4a45a088edb6517555aa7e06e5f86 |
|
30-Sep-2015 |
Aaro Koskinen <aaro.koskinen@nokia.com> |
fileio: make get_status_field() more generic
All users of get_status_field() expect the field pattern to occur in
the beginning of a line, and the delimiter is ':'.
Hardcode this into the function, and also skip any whitespace before ':'
to support fields in files like /proc/cpuinfo. Add support for returning
the full field value (currently stops on first whitespace).
Rename the function so it's easier to ensure all callers switch to new
semantics. |
15dee3f07c646fd345b0aa30c6566071b3365db7 |
|
06-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
networkd: be more defensive when writing to ipv4/ipv6 forwarding settings
1) never bother with setting the flag for loopback devices
2) if we fail to write the flag due to EROFS (which is likely to happen
in containers where /proc/sys is read-only) or any other error, check
if the flag already has the right value. If so, don't complain.
Closes #469 |