summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2020-06-30 16:42:36 +0200
committerEmmanuel Dreyfus <manu@netbsd.org>2020-06-30 16:43:25 +0200
commitb29d5236ec6a41842752043bbe602a1510ac12f3 (patch)
tree995855cc0e7713af8435be473e596df700e08d9b
parent384431030a7f2c4d303cabe1406a87be773ba0c4 (diff)
NetBSD build fixes
- Make sure -largp is used at link time - PTHREAD_MUTEX_ADAPTIVE_NP is not available, use PTHREAD_MUTEX_DEFAULT instead - Avoid non POSIX [[ ]] in scripts - Do not check of lock.spinlock is NULL since it is not a pointer (it is not a pointer on Linux either) Change-Id: I5e04a7c552d24f8a473c2b837828d1bddfa7e128 Fixes: #1347 Type: Bug Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
-rw-r--r--configure.ac3
-rw-r--r--rpc/rpc-lib/src/rpcsvc.c4
-rw-r--r--tools/gfind_missing_files/gfind_missing_files.sh2
-rw-r--r--xlators/performance/write-behind/src/write-behind.c4
4 files changed, 10 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index c2dc202..b3966e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -968,6 +968,9 @@ case $host_os in
CFLAGS="${CFLAGS} -isystem /usr/local/include"
ARGP_LDADD=-largp
;;
+ *netbsd*)
+ ARGP_LDADD=-largp
+ ;;
esac
dnl argp-standalone does not provide a pkg-config file
AC_CHECK_HEADER([argp.h], AC_DEFINE(HAVE_ARGP, 1, [have argp]))
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
index eace6ea..4297af4 100644
--- a/rpc/rpc-lib/src/rpcsvc.c
+++ b/rpc/rpc-lib/src/rpcsvc.c
@@ -41,6 +41,10 @@
#include "xdr-rpcclnt.h"
#include <glusterfs/glusterfs-acl.h>
+#ifndef PTHREAD_MUTEX_ADAPTIVE_NP
+#define PTHREAD_MUTEX_ADAPTIVE_NP PTHREAD_MUTEX_DEFAULT
+#endif
+
static struct rpcsvc_program gluster_dump_prog;
#define rpcsvc_alloc_request(svc, request) \
diff --git a/tools/gfind_missing_files/gfind_missing_files.sh b/tools/gfind_missing_files/gfind_missing_files.sh
index f42fe7b..e7aaa0b 100644
--- a/tools/gfind_missing_files/gfind_missing_files.sh
+++ b/tools/gfind_missing_files/gfind_missing_files.sh
@@ -61,7 +61,7 @@ mount_slave()
parse_cli()
{
- if [[ $# -ne 4 ]]; then
+ if [ "$#" -ne 4 ]; then
echo "Usage: gfind_missing_files <brick-path> <slave-host> <slave-vol> <OUTFILE>"
exit 1
else
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index e1d0e9a..00cfca0 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -2489,7 +2489,7 @@ wb_mark_readdirp_start(xlator_t *this, inode_t *directory)
wb_directory_inode = wb_inode_create(this, directory);
- if (!wb_directory_inode || !wb_directory_inode->lock.spinlock)
+ if (!wb_directory_inode)
return;
LOCK(&wb_directory_inode->lock);
@@ -2509,7 +2509,7 @@ wb_mark_readdirp_end(xlator_t *this, inode_t *directory)
wb_directory_inode = wb_inode_ctx_get(this, directory);
- if (!wb_directory_inode || !wb_directory_inode->lock.spinlock)
+ if (!wb_directory_inode)
return;
LOCK(&wb_directory_inode->lock);