update: refactor and rename

This commit is contained in:
ngn
2024-08-01 04:48:11 +03:00
parent 48d177965e
commit 4354fb8b89
30 changed files with 642 additions and 626 deletions

View File

@ -4,14 +4,14 @@
#include <fcntl.h>
#include <unistd.h>
lock_st lock() {
if (exists(mc_lock_path))
lock_st lock(char *lock_path) {
if (exists(lock_path))
return ALREADY_LOCKED;
if (creat(mc_lock_path, 0600) == -1)
if (creat(lock_path, 0600) == -1)
return LOCK_ERROR;
return LOCK_SUCCESS;
}
void unlock() {
unlink(mc_lock_path);
void unlock(char *lock_path) {
unlink(lock_path);
}