diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-04-08 22:43:52 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-04-08 22:46:56 +0200 |
commit | 4b73a0c0612d26d49791f389e92f85d6444c36af (patch) | |
tree | af9107d5bd1e395b564990d1507cc762f5742607 /src/shared | |
parent | d3a86981d1ae4c1d668e18868c3e6c9d2f23c144 (diff) |
machine-id: fix missing initializationsystemd/v201
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/util.c | 11 | ||||
-rw-r--r-- | src/shared/util.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index 49d2a0dace..57943b6411 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -234,6 +234,17 @@ void close_many(const int fds[], unsigned n_fd) { close_nointr_nofail(fds[i]); } +int unlink_noerrno(const char *path) { + PROTECT_ERRNO; + int r; + + r = unlink(path); + if (r < 0) + return -errno; + + return 0; +} + int parse_boolean(const char *v) { assert(v); diff --git a/src/shared/util.h b/src/shared/util.h index bea43fc4bc..38851237ab 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -646,3 +646,5 @@ static inline unsigned u64log2(uint64_t n) { static inline bool logind_running(void) { return access("/run/systemd/seats/", F_OK) >= 0; } + +int unlink_noerrno(const char *path); |