diff options
author | Emmanuel Dreyfus <manu@netbsd.org> | 2014-09-23 21:14:27 +0200 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-24 00:03:53 -0700 |
commit | 1f6e992f1aaa676be5bd47d17e58f1171825cf43 (patch) | |
tree | 1ac049e7b0f8e105b0a9e0d12fc57e8b573c34a0 /xlators | |
parent | 49782abc2f925ffcbd3148b8db851237e693d018 (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.
Backport of I8f469c5741a85b6e8d8f6299a9540b3d64611d2f
BUG: 1138897
Change-Id: I279752f2ec5db1abc25830cb9a23290cc401d517
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8828
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-quota.c | 14 |
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); |