X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fmain.cc;h=967ec71a21f319b1cd5602d262167bd4f7f7d334;hb=d7074cbf00c63fad11bae0750f48508fba43aceb;hp=6721b5aa14c32363a80eec88d26540c1cb9f089d;hpb=f47caf2833675cce0b62a6e4ffd6764c1490a8b4;p=m6w6%2Flibmemcached diff --git a/libtest/main.cc b/libtest/main.cc index 6721b5aa..967ec71a 100644 --- a/libtest/main.cc +++ b/libtest/main.cc @@ -34,7 +34,7 @@ * */ -#include +#include "mem_config.h" #include #include @@ -220,22 +220,22 @@ int main(int argc, char *argv[]) is_massive(opt_massive); } - char buffer[1024]; + char tmp_directory[1024]; if (getenv("LIBTEST_TMP")) { - snprintf(buffer, sizeof(buffer), "%s", getenv("LIBTEST_TMP")); + snprintf(tmp_directory, sizeof(tmp_directory), "%s", getenv("LIBTEST_TMP")); } else { - snprintf(buffer, sizeof(buffer), "%s", LIBTEST_TEMP); + snprintf(tmp_directory, sizeof(tmp_directory), "%s", LIBTEST_TEMP); } - if (chdir(buffer) == -1) + if (chdir(tmp_directory) == -1) { char getcwd_buffer[1024]; char *dir= getcwd(getcwd_buffer, sizeof(getcwd_buffer)); - Error << "Unable to chdir() from " << dir << " to " << buffer << " errno:" << strerror(errno); + Error << "Unable to chdir() from " << dir << " to " << tmp_directory << " errno:" << strerror(errno); return EXIT_FAILURE; } @@ -329,10 +329,7 @@ int main(int argc, char *argv[]) std::ofstream xml_file; std::string file_name; - if (getenv("LIBTEST_TEMP")) - { - file_name.append(getenv("LIBTEST_TEMP")); - } + file_name.append(tmp_directory); file_name.append(frame->name()); file_name.append(".xml"); xml_file.open(file_name.c_str(), std::ios::trunc);