summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2012-07-06 16:53:35 +0200
committerAnand Avati <avati@redhat.com>2012-07-13 14:08:22 -0700
commit74d7d2d53c539c822cf7b6da44a515f1e326c5bc (patch)
tree0829ae1fd01e0639bb00110ac6075f3774f34c36 /xlators
parente14095fbbe5c410863ffca865803762dd8cf6e87 (diff)
NetBSD build fixes
This is a backport of Change-Id: Icd7290f1e340675d763665a0d0c5f95bc14e0c55 BUG: 764655 Change-Id: Iaca3dc30e61c0864af673b90d2a7fdea6a3143cc Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.com/3577 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/marker/utils/src/procdiggy.h4
-rwxr-xr-xxlators/mount/fuse/utils/mount.glusterfs.in18
2 files changed, 18 insertions, 4 deletions
diff --git a/xlators/features/marker/utils/src/procdiggy.h b/xlators/features/marker/utils/src/procdiggy.h
index f4586de6c67..ee87b0e3916 100644
--- a/xlators/features/marker/utils/src/procdiggy.h
+++ b/xlators/features/marker/utils/src/procdiggy.h
@@ -17,6 +17,10 @@
<http://www.gnu.org/licenses/>.
*/
+#ifdef __NetBSD__
+#include <sys/syslimits.h>
+#endif /* __NetBSD__ */
+
#define PROC "/proc"
pid_t pidinfo (pid_t pid, char **name);
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
index 0b304b71468..a43efe531d7 100755
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# (C) 2006, 2007, 2008 Gluster Inc. <http://www.gluster.com>
#
# This program is free software; you can redistribute it and/or
@@ -218,7 +218,7 @@ check_recursive_mount ()
return;
fi
- brick_path=(`grep ^path "$GLUSTERD_WORKDIR"/vols/*/bricks/* | cut -d "=" -f 2`);
+ brick_path=`grep ^path "$GLUSTERD_WORKDIR"/vols/*/bricks/* | cut -d "=" -f 2`;
root_inode=`stat -Lc %i /`;
root_dev=`stat -Lc %d /`;
mnt_inode=`stat -Lc %i $mnt_dir`;
@@ -269,7 +269,8 @@ main ()
# "mount -t glusterfs" sends this, but it's useless.
"rw") ;;
*)
- read key value < <(echo "$pair" | tr "=" " ")
+ key=$(echo "$pair" | cut -f1 -d'=');
+ value=$(echo "$pair" | cut -f2- -d'=');
# Handle options with values.
case "$key" in
"log-level") log_level_str=$value ;;
@@ -329,8 +330,17 @@ main ()
exit 0;
}
+ case `uname -s` in
+ NetBSD)
+ mounttab=/proc/mounts
+ ;;
+ Linux)
+ mounttab=/etc/mtab
+ ;;
+ esac
+
# Simple check to avoid multiple identical mounts
- if grep -q " $mount_point fuse" /etc/mtab; then
+ if grep -q " ${mount_point}.*fuse" $mounttab; then
echo -n "$0: according to mtab, GlusterFS is already mounted on "
echo "$mount_point"
exit 0;