termux-packages/packages/nzbget/nzbget.cpp.patch

23 lines
610 B
Diff
Raw Normal View History

2018-01-09 18:54:15 +01:00
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);