summaryrefslogtreecommitdiff
path: root/src/basic/lockfile-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/lockfile-util.c')
-rw-r--r--src/basic/lockfile-util.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/basic/lockfile-util.c b/src/basic/lockfile-util.c
index 05e16d1caa..3ee4191e4d 100644
--- a/src/basic/lockfile-util.c
+++ b/src/basic/lockfile-util.c
@@ -1,5 +1,3 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
/***
This file is part of systemd.
@@ -19,17 +17,19 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdlib.h>
-#include <stdbool.h>
#include <errno.h>
-#include <string.h>
+#include <fcntl.h>
#include <stdio.h>
-#include <limits.h>
+#include <string.h>
#include <sys/file.h>
+#include <sys/stat.h>
-#include "util.h"
+#include "alloc-util.h"
+#include "fd-util.h"
+#include "fs-util.h"
#include "lockfile-util.h"
-#include "fileio.h"
+#include "macro.h"
+#include "path-util.h"
int make_lock_file(const char *p, int operation, LockFile *ret) {
_cleanup_close_ int fd = -1;
@@ -145,8 +145,7 @@ void release_lock_file(LockFile *f) {
if ((f->operation & ~LOCK_NB) == LOCK_EX)
unlink_noerrno(f->path);
- free(f->path);
- f->path = NULL;
+ f->path = mfree(f->path);
}
f->fd = safe_close(f->fd);