Adding lockfile.c
moving code from compile.c under an api so it can be reused.
This commit is contained in:
parent
00e149c04c
commit
5a5a3d33e4
4 changed files with 104 additions and 29 deletions
18
lockfile.h
Normal file
18
lockfile.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
#ifndef LOCKFILE_H
|
||||
#define LOCKFILE_H
|
||||
|
||||
struct lockfile {
|
||||
int fd;
|
||||
char name[4096];
|
||||
};
|
||||
|
||||
#define LOCKFILE_INIT { -1, { 0 } }
|
||||
|
||||
int hold_lock(struct lockfile *lock, const char *filename, int force);
|
||||
|
||||
int commit_lock(struct lockfile *lock);
|
||||
|
||||
int release_lock(struct lockfile *lock);
|
||||
|
||||
#endif /* LOCKFILE_H */
|
||||
Reference in a new issue