chiark / gitweb /
bootctl: create loader.conf only if it doesn't exist yet
[elogind.git] / src / basic / fs-util.h
index 3f47537..60f465a 100644 (file)
@@ -104,3 +104,9 @@ static inline void rmdir_and_free(char *p) {
         free(p);
 }
 DEFINE_TRIVIAL_CLEANUP_FUNC(char*, rmdir_and_free);
+
+static inline void unlink_and_free(char *p) {
+        (void) unlink(p);
+        free(p);
+}
+DEFINE_TRIVIAL_CLEANUP_FUNC(char*, unlink_and_free);