diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-02-27 17:50:45 +0100 |
---|---|---|
committer | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-02-27 17:50:45 +0100 |
commit | 7aab4808ffb8dff024b43cb3fc7760fa58988fdc (patch) | |
tree | 79508d8f035a396a94b2a6c23202b1c3ec94bed1 | |
parent | de3f80cd243b28fa6a9e9c3dbb5da7a09faa848d (diff) | |
download | ceph-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.cc | 2 |
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 |