From 7aab4808ffb8dff024b43cb3fc7760fa58988fdc Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 27 Feb 2013 17:50:45 +0100 Subject: [PATCH] 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 --- src/common/code_environment.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/code_environment.cc b/src/common/code_environment.cc index 58b27f860493..2cf19f48bc57 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 -- 2.47.3