summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 49d2a0dac..57943b641 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);