summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-02-27 17:50:45 +0100
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-02-27 17:50:45 +0100
commit7aab4808ffb8dff024b43cb3fc7760fa58988fdc (patch)
tree79508d8f035a396a94b2a6c23202b1c3ec94bed1
parentde3f80cd243b28fa6a9e9c3dbb5da7a09faa848d (diff)
downloadceph-7aab4808ffb8dff024b43cb3fc7760fa58988fdc.tar.gz
code_environment.cc: move variable ret in get_process_name()
Move 'ret' in get_process_name() to the correct block to suppress warning about unused variable in cppcheck. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r--src/common/code_environment.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/code_environment.cc b/src/common/code_environment.cc
index 58b27f86049..2cf19f48bc5 100644
--- a/src/common/code_environment.cc
+++ b/src/common/code_environment.cc
@@ -47,7 +47,6 @@ std::ostream &operator<<(std::ostream &oss, enum code_environment_t e)
int get_process_name(char *buf, int len)
{
- int ret;
if (len <= 16) {
/* The man page discourages using this prctl with a buffer shorter
* than 16 bytes. With a 16-byte buffer, it might not be
@@ -59,6 +58,7 @@ int get_process_name(char *buf, int len)
return -ENAMETOOLONG;
#else
memset(buf, 0, len);
+ int ret;
ret = prctl(PR_GET_NAME, buf);
return ret;
#endif