2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2015-05-04 22:12:46 +02:00
|
|
|
#pragma once
|
|
|
|
|
2015-11-30 21:43:37 +01:00
|
|
|
#include <stddef.h>
|
|
|
|
|
2015-05-04 22:12:46 +02:00
|
|
|
#include "macro.h"
|
|
|
|
#include "missing.h"
|
|
|
|
|
|
|
|
typedef struct LockFile {
|
|
|
|
char *path;
|
|
|
|
int fd;
|
|
|
|
int operation;
|
|
|
|
} LockFile;
|
|
|
|
|
|
|
|
int make_lock_file(const char *p, int operation, LockFile *ret);
|
|
|
|
int make_lock_file_for(const char *p, int operation, LockFile *ret);
|
|
|
|
void release_lock_file(LockFile *f);
|
|
|
|
|
|
|
|
#define LOCK_FILE_INIT { .fd = -1, .path = NULL }
|