mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-20 06:56:28 -05:00
Uses a lock file instead than a pid file.
It's more appropriate for a not daemon.
This commit is contained in:
parent
bc2a837953
commit
fceaa8a4cf
7 changed files with 46 additions and 70 deletions
12
util.h
12
util.h
|
|
@ -487,19 +487,19 @@ static inline oathash_t oathashm(oathash_t hash, const unsigned char* value, uns
|
|||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* pid */
|
||||
/* lock */
|
||||
|
||||
/**
|
||||
* Creates and locks the pid file.
|
||||
* Returns -1 on error, otherwise it's the file handle to pass to pid_unlock().
|
||||
* Creates and locks the lock file.
|
||||
* Returns -1 on error, otherwise it's the file handle to pass to lock_unlock().
|
||||
*/
|
||||
int pid_lock(const char* file);
|
||||
int lock_lock(const char* file);
|
||||
|
||||
/**
|
||||
* Unlocks the pid file.
|
||||
* Unlocks the lock file.
|
||||
* Returns -1 on error.
|
||||
*/
|
||||
int pid_unlock(int f, const char* file);
|
||||
int lock_unlock(int f);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue