pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/rspamd mail/rspamd: Provide endian detection and ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6f67db5d34ea
branches:  trunk
changeset: 374931:6f67db5d34ea
user:      fhajny <fhajny%pkgsrc.org@localhost>
date:      Wed Jan 31 20:09:20 2018 +0000

description:
mail/rspamd: Provide endian detection and fcntl support. Fixes SunOS builds.

diffstat:

 mail/rspamd/distinfo                          |   4 +-
 mail/rspamd/patches/patch-config.h.in         |  20 ++++++++
 mail/rspamd/patches/patch-src_lua_lua__util.c |  62 +++++++++++++++++++++++++++
 3 files changed, 85 insertions(+), 1 deletions(-)

diffs (105 lines):

diff -r 9b3106bd4e4e -r 6f67db5d34ea mail/rspamd/distinfo
--- a/mail/rspamd/distinfo      Wed Jan 31 19:37:49 2018 +0000
+++ b/mail/rspamd/distinfo      Wed Jan 31 20:09:20 2018 +0000
@@ -1,8 +1,10 @@
-$NetBSD: distinfo,v 1.15 2017/06/23 13:47:05 wiz Exp $
+$NetBSD: distinfo,v 1.16 2018/01/31 20:09:20 fhajny Exp $
 
 SHA1 (rspamd-1.6.1.tar.gz) = c2fb3b8aae561932b2cde746b77bdeb1ba5ea0c9
 RMD160 (rspamd-1.6.1.tar.gz) = 1576044887557da12075776dbf259e25f4d00dfe
 SHA512 (rspamd-1.6.1.tar.gz) = 3bd50ebc1d7e413afbe52608f94b644e1cf684a708776207710eb4556abb0500b2a23141a90e811854a25a9fbedf0a6b1c5a05363c0cf372921b8acd457b702b
 Size (rspamd-1.6.1.tar.gz) = 2462565 bytes
 SHA1 (patch-CMakeLists.txt) = 1d3e66b52ef38638674baf4c10b68c97b2ca38ad
+SHA1 (patch-config.h.in) = 1e626956227dc69fb781ce5847e0f9f8eaee8c09
 SHA1 (patch-src_CMakeLists.txt) = c80015bb275ba8b9ad31491311275bf353f8f30a
+SHA1 (patch-src_lua_lua__util.c) = 9aebe7e7d88e4dced48cf5016ce932b2da5020d0
diff -r 9b3106bd4e4e -r 6f67db5d34ea mail/rspamd/patches/patch-config.h.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/rspamd/patches/patch-config.h.in     Wed Jan 31 20:09:20 2018 +0000
@@ -0,0 +1,20 @@
+$NetBSD: patch-config.h.in,v 1.1 2018/01/31 20:09:20 fhajny Exp $
+
+Add endianness support for earlier SunOS platforms.
+
+--- config.h.in.orig   2017-06-14 14:45:41.000000000 +0000
++++ config.h.in
+@@ -151,6 +151,13 @@
+  #include <sys/endian.h>
+ #elif defined(HAVE_MACHINE_ENDIAN_H)
+  #include <machine/endian.h>
++#elif defined(__sun)
++ #include <sys/byteorder.h>
++ #ifdef _LITTLE_ENDIAN
++  #define BYTE_ORDER LITTLE_ENDIAN
++ #else
++  #define BYTE_ORDER BIG_ENDIAN
++ #endif
+ #endif
+ 
+ #ifndef BYTE_ORDER
diff -r 9b3106bd4e4e -r 6f67db5d34ea mail/rspamd/patches/patch-src_lua_lua__util.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/rspamd/patches/patch-src_lua_lua__util.c     Wed Jan 31 20:09:20 2018 +0000
@@ -0,0 +1,62 @@
+$NetBSD: patch-src_lua_lua__util.c,v 1.1 2018/01/31 20:09:20 fhajny Exp $
+
+Add fcntl support (namely for SunOS).
+
+--- src/lua/lua_util.c.orig    2017-06-14 14:45:41.000000000 +0000
++++ src/lua/lua_util.c
+@@ -1544,6 +1544,15 @@ lua_util_lock_file (lua_State *L)
+       gint fd = -1;
+       gboolean own = FALSE;
+ 
++#if !HAVE_FLOCK
++      struct flock fl = {
++              .l_type = F_WRLCK,
++              .l_whence = SEEK_SET,
++              .l_start = 0,
++              .l_len = 0
++      };
++#endif
++
+       fpath = luaL_checkstring (L, 1);
+ 
+       if (fpath) {
+@@ -1562,7 +1571,11 @@ lua_util_lock_file (lua_State *L)
+                       return 2;
+               }
+ 
++#if HAVE_FLOCK
+               if (flock (fd, LOCK_EX) == -1) {
++#else
++              if (fcntl (fd, F_SETLKW, &fl) == -1) {
++#endif
+                       lua_pushnil (L);
+                       lua_pushstring (L, strerror (errno));
+ 
+@@ -1588,6 +1601,15 @@ lua_util_unlock_file (lua_State *L)
+       gint fd = -1, ret, serrno;
+       gboolean do_close = TRUE;
+ 
++#if !HAVE_FLOCK
++      struct flock fl = {
++              .l_type = F_UNLCK,
++              .l_whence = SEEK_SET,
++              .l_start = 0,
++              .l_len = 0
++      };
++#endif
++
+       if (lua_isnumber (L, 1)) {
+               fd = lua_tonumber (L, 1);
+ 
+@@ -1595,7 +1617,11 @@ lua_util_unlock_file (lua_State *L)
+                       do_close = lua_toboolean (L, 2);
+               }
+ 
++#if HAVE_FLOCK
+               ret = flock (fd, LOCK_UN);
++#else
++              ret = fcntl (fd, F_SETLKW, &fl);
++#endif
+ 
+               if (do_close) {
+                       serrno = errno;



Home | Main Index | Thread Index | Old Index