lock-util: make global lock return parameter to image_path_lock() optional
When adding unprivileged nspawn support we don't really want a global lock file, since we cannot even access the dir they are stored in, hence make the concept optional. Some minor other modernizations.
This commit is contained in:
@@ -17,7 +17,7 @@ static inline 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 { .dir_fd = -EBADF, .fd = -EBADF }
|
||||
#define LOCK_FILE_INIT (LockFile) { .dir_fd = -EBADF, .fd = -EBADF }
|
||||
|
||||
/* POSIX locks with the same interface as flock(). */
|
||||
int posix_lock(int fd, int operation);
|
||||
|
||||
Reference in New Issue
Block a user