projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Fix print
[awesomized/libmemcached]
/
libtest
/
main.cc
diff --git
a/libtest/main.cc
b/libtest/main.cc
index 6bffa84cf86688a6be22fa55fcd47153375287f4..c405bf203fd72732f39f8e098732d923360f53d7 100644
(file)
--- a/
libtest/main.cc
+++ b/
libtest/main.cc
@@
-34,7
+34,7
@@
*
*/
*
*/
-#include
<config.h>
+#include
"libtest/yatlcon.h"
#include <libtest/common.h>
#include <cassert>
#include <libtest/common.h>
#include <cassert>
@@
-220,22
+220,24
@@
int main(int argc, char *argv[])
is_massive(opt_massive);
}
is_massive(opt_massive);
}
- char tmp_directory[1024];
+ libtest::vchar_t tmp_directory;
+ tmp_directory.resize(1024);
if (getenv("LIBTEST_TMP"))
{
if (getenv("LIBTEST_TMP"))
{
- snprintf(
tmp_directory, sizeof(tmp_directory
), "%s", getenv("LIBTEST_TMP"));
+ snprintf(
&tmp_directory[0], tmp_directory.size(
), "%s", getenv("LIBTEST_TMP"));
}
else
{
}
else
{
- snprintf(
tmp_directory, sizeof(tmp_directory
), "%s", LIBTEST_TEMP);
+ snprintf(
&tmp_directory[0], tmp_directory.size(
), "%s", LIBTEST_TEMP);
}
}
- if (chdir(
tmp_directory
) == -1)
+ if (chdir(
&tmp_directory[0]
) == -1)
{
{
- char getcwd_buffer[1024];
- char *dir= getcwd(getcwd_buffer, sizeof(getcwd_buffer));
+ libtest::vchar_t getcwd_buffer;
+ getcwd_buffer.resize(1024);
+ char *dir= getcwd(&getcwd_buffer[0], getcwd_buffer.size());
- Error << "Unable to chdir() from " << dir << " to " <<
tmp_directory
<< " errno:" << strerror(errno);
+ Error << "Unable to chdir() from " << dir << " to " <<
&tmp_directory[0]
<< " errno:" << strerror(errno);
return EXIT_FAILURE;
}
return EXIT_FAILURE;
}
@@
-329,7
+331,7
@@
int main(int argc, char *argv[])
std::ofstream xml_file;
std::string file_name;
std::ofstream xml_file;
std::string file_name;
- file_name.append(
tmp_directory
);
+ file_name.append(
&tmp_directory[0]
);
file_name.append(frame->name());
file_name.append(".xml");
xml_file.open(file_name.c_str(), std::ios::trunc);
file_name.append(frame->name());
file_name.append(".xml");
xml_file.open(file_name.c_str(), std::ios::trunc);
@@
-343,11
+345,6
@@
int main(int argc, char *argv[])
std::cerr << "FATAL:" << e.what() << std::endl;
exit_code= EXIT_FAILURE;
}
std::cerr << "FATAL:" << e.what() << std::endl;
exit_code= EXIT_FAILURE;
}
- catch (libtest::start& e)
- {
- std::cerr << "Failure to start:" << e.what() << std::endl;
- exit_code= EXIT_FAILURE;
- }
catch (libtest::disconnected& e)
{
std::cerr << "Unhandled disconnection occurred:" << e.what() << std::endl;
catch (libtest::disconnected& e)
{
std::cerr << "Unhandled disconnection occurred:" << e.what() << std::endl;