Skip to content

Commit

Permalink
fallback to non-exclusive lock if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryptkeeper committed Aug 6, 2024
1 parent 145387d commit d79aef3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ static struct {
int fd;
} lfh; /* lock file handle */

#if defined(__linux__)
#define EXFILELOCKFLAG F_EXLCK
#elif defined(__APPLE__)
#if defined(O_EXLOCK)
#define EXFILELOCKFLAG O_EXLOCK
#elif defined(F_EXLCK)
#define EXFILELOCKFLAG F_EXLCK
#else
#define EXFILELOCKFLAG 0
#endif

/// @brief Creates and locks a lock file in the search directory.
Expand Down

0 comments on commit d79aef3

Please sign in to comment.