Archived
1
0
Fork 0

Adding lockfile.c

moving code from compile.c under an api so it can be reused.
This commit is contained in:
Henrik Hautakoski 2011-06-13 19:34:56 +02:00
parent 00e149c04c
commit 5a5a3d33e4
4 changed files with 104 additions and 29 deletions

18
lockfile.h Normal file
View 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 */