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.

23 lines
610 B

diff --git a/daemon/main/nzbget.cpp b/daemon/main/nzbget.cpp
index 1cfa105..b5cee58 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"
@@ -913,7 +915,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);