Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
daemons: lib: changed lock from
flock()
to fcntl()
`flock()` was a good solution to lock the pid file in the main program (before forking) and keep the lock after the fork (pass it to child process). But unfortunately, `flock()` is not supported on `Solaris` systems, and therefore cannot be used here. `fcntl()` can do the same base job and is supported on all the platforms Bareos supports. But the issue with it, is that the lock is not kept and passed to the child process when forking. That is why the locking code was moved inside the forked daemon when writing to the pid file.
- Loading branch information
1 parent
bc2655b
commit 50451d1
Showing
7 changed files
with
71 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters