diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-12-13 20:31:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-13 20:31:09 +0100 |
commit | 9ef4e1e5a2d0a9cc50406f1cae05f3918d6f0c2a (patch) | |
tree | a5c2639173e88e00927445ac5dffdf88b3fe52aa /src/libsystemd | |
parent | 6916b164642d8bb4938878f4284f8ee5ccf3efd6 (diff) | |
parent | 069a254f9b5133ebf9e2258628917954b75d6b86 (diff) |
Merge pull request #4877 from evverx/fix-machine-id
handle corrupted /etc/machine-id nicer
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-id128/id128-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-id128/id128-util.c b/src/libsystemd/sd-id128/id128-util.c index 337eae24b4..e6d45c18e3 100644 --- a/src/libsystemd/sd-id128/id128-util.c +++ b/src/libsystemd/sd-id128/id128-util.c @@ -186,7 +186,7 @@ int id128_write_fd(int fd, Id128Format f, sd_id128_t id, bool do_sync) { int id128_write(const char *p, Id128Format f, sd_id128_t id, bool do_sync) { _cleanup_close_ int fd = -1; - fd = open(p, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0444); + fd = open(p, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY|O_TRUNC, 0444); if (fd < 0) return -errno; |