summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-quota.c
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2014-09-20 06:57:24 +0200
committerVijay Bellur <vbellur@redhat.com>2014-09-23 09:52:39 -0700
commit5136c938dddd909ad7a998afa643dc3dcaa6233d (patch)
tree5a4a12923b3e43b8d3a85be1bf23624bc72862f7 /xlators/mgmt/glusterd/src/glusterd-quota.c
parent5f79d6e08fbb930aa67dd59eb39cbece6f138b59 (diff)
Do not hardcode setfattr(1) path
Turn setfattr(1) absolute path into an OS-dependant macro. Let compiler option override it to fit custom installation if needed. BUG: 1129939 Change-Id: I8f469c5741a85b6e8d8f6299a9540b3d64611d2f Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8786 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-quota.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-quota.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c
index f2f742ddaf2..a6712aa7900 100644
--- a/xlators/mgmt/glusterd/src/glusterd-quota.c
+++ b/xlators/mgmt/glusterd/src/glusterd-quota.c
@@ -28,6 +28,18 @@
#include <sys/wait.h>
#include <dlfcn.h>
+#ifndef _PATH_SETFATTR
+# ifdef GF_LINUX_HOST_OS
+# define _PATH_SETFATTR "/usr/bin/setfattr"
+# endif
+# ifdef __NetBSD__
+# define _PATH_SETFATTR "/usr/pkg/bin/setfattr"
+# endif
+# ifdef __FreeBSD__
+# define _PATH_SETFATTR "/usr/local/bin/setfattr"
+# endif
+#endif
+
/* Any negative pid to make it special client */
#define QUOTA_CRAWL_PID "-100"
@@ -223,7 +235,7 @@ glusterd_quota_initiate_fs_crawl (glusterd_conf_t *priv, char *volname,
else if (type == GF_QUOTA_OPTION_TYPE_DISABLE)
runner_add_args (&runner, "/usr/bin/find", ".",
- "-exec", "/usr/bin/setfattr", "-n",
+ "-exec", _PATH_SETFATTR, "-n",
VIRTUAL_QUOTA_XATTR_CLEANUP_KEY, "-v",
"1", "{}", "\\", ";", NULL);