diff options
author | Xavi Hernandez <xhernandez@redhat.com> | 2018-07-06 20:23:35 +0200 |
---|---|---|
committer | Xavi Hernandez <xhernandez@redhat.com> | 2018-07-10 16:28:24 +0200 |
commit | 6dc5dfef819cad69d6d4b4c1c305efa74236ad84 (patch) | |
tree | 6b325caf478689d8113279191ca1916e5f5b32ea /xlators/mgmt/glusterd/src/glusterd-hooks.h | |
parent | 03f1f5bdc46076178f1afdf8e2a76c5b973fe11f (diff) |
Fix compile warnings
This patch fixes compile warnings that appear with newer compilers. The
solution applied is only to remove the warnings, but it doesn't always
solve the problem in the best way. It assumes that the problem will never
happen, as the previous code assumed.
Change-Id: I6e8470d6c2e2dbd3bd7d324b5fd2f92ffdc3d6ec
updates: bz#1193929
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-hooks.h')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-hooks.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-hooks.h b/xlators/mgmt/glusterd/src/glusterd-hooks.h index 7bab6adb626..752e459f89c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-hooks.h +++ b/xlators/mgmt/glusterd/src/glusterd-hooks.h @@ -13,8 +13,14 @@ #include <fnmatch.h> #define GLUSTERD_GET_HOOKS_DIR(path, version, priv) \ - snprintf (path, PATH_MAX, "%s/hooks/%d", priv->workdir,\ - version); + do { \ + int32_t len; \ + len = snprintf (path, PATH_MAX, "%s/hooks/%d", priv->workdir,\ + version); \ + if (len < 0) { \ + path[0] = 0; \ + } \ + } while (0) #define GLUSTERD_HOOK_VER 1 |