termux-packages/packages/nzbget/nzbget.cpp.patch
Marcel Dopita 3bb128bfec nzbget: Update from 19.1 to 20.0
Also fixes overwriting of config file during package upgrade. Use config in etc
as default instead (leaves config in users home to allow overriding).
2018-06-20 01:37:25 +02:00

23 lines
612 B
Diff

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);