Source: burp
Version: 1.4.12-1
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd

Hi,

Currently burp fails to build from source due to that the lockf()
function is not yet implemented for GNU/Hurd. As a workaround until it
is available use flock() instead. The attached patch fixes this problem
by using this function. All 12 tests succeed, and they are a
prerequisite for building the package.

Thanks!


--- a/src/lock.c	2014-03-29 06:19:55.000000000 +0100
+++ b/src/lock.c	2014-05-10 22:26:44.000000000 +0200
@@ -2,6 +2,9 @@
 #include "lock.h"
 #include "log.h"
 #include "handy.h"
+#ifdef __GNU__
+#include "sys/file.h"
+#endif
 
 // Return 0 for lock got, 1 for lock not got, -1 for error.
 int get_lock(const char *path)
@@ -30,7 +33,11 @@
 
 	if((fdlock=open(path, O_WRONLY|O_CREAT, 0666))==-1)
 		return -1;
+#ifdef __GNU__
+	if(flock(fdlock, LOCK_EX))
+#else
 	if(lockf(fdlock, F_TLOCK, 0))
+#endif
 	{
 		if(errno==EACCES || errno==EAGAIN)
 			return 1; // Lock not got.

Reply via email to