You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

22 lines
612 B

diff --git a/daemon/main/nzbget.cpp b/daemon/main/nzbget.cpp
index c4f27721..aabf69cc 100644
--- a/daemon/main/nzbget.cpp
+++ b/daemon/main/nzbget.cpp
@@ -19,6 +19,8 @@
*/
+#include <sys/file.h>
+
#include "nzbget.h"
#include "ServerPool.h"
#include "Log.h"
@@ -932,7 +934,7 @@ void NZBGet::Daemonize()
error("Starting daemon failed: could not create lock-file %s", m_options->GetLockFile());
exit(1);
}
- if (lockf(lfp, F_TLOCK, 0) < 0)
+ if (flock(lfp, LOCK_EX) < 0)
{
error("Starting daemon failed: could not acquire lock on lock-file %s", m_options->GetLockFile());
exit(1);