Skip to content

Commit

Permalink
Addressed some compilation issue found on Alpine 3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime VISONNEAU committed Jun 8, 2016
1 parent 76a83da commit 7e14216
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
24 changes: 12 additions & 12 deletions libtest/cmdline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ using namespace libtest;
#include <unistd.h>

#ifndef __USE_GNU
static char **environ= NULL;
char **environ= NULL;
#endif

extern "C" {
Expand Down Expand Up @@ -136,7 +136,7 @@ Application::Application(const std::string& arg, const bool _use_libtool_arg) :
stderr_fd(STDERR_FILENO),
built_argv(NULL),
_pid(-1)
{
{
if (_use_libtool)
{
if (libtool() == NULL)
Expand Down Expand Up @@ -193,7 +193,7 @@ Application::error_t Application::run(const char *args[])
sigset_t set;
sigemptyset(&set);
fatal_assert(posix_spawnattr_setsigmask(&spawnattr, &set) == 0);

create_argv(args);

int spawn_ret;
Expand All @@ -204,7 +204,7 @@ Application::error_t Application::run(const char *args[])
file_stream.open(gdb_run_file.c_str(), std::fstream::out | std::fstream::trunc);

_gdb_filename= create_tmpfile(_exectuble_name);
file_stream
file_stream
<< "set logging redirect on" << std::endl
<< "set logging file " << _gdb_filename << std::endl
<< "set logging overwrite on" << std::endl
Expand All @@ -227,8 +227,8 @@ Application::error_t Application::run(const char *args[])
const_cast<char *>("-batch"),
const_cast<char *>("-f"),
const_cast<char *>("-x"),
const_cast<char *>(gdb_run_file.c_str()),
const_cast<char *>(_exectuble_with_path.c_str()),
const_cast<char *>(gdb_run_file.c_str()),
const_cast<char *>(_exectuble_with_path.c_str()),
0};

spawn_ret= posix_spawnp(&_pid, libtool(), &file_actions, &spawnattr, argv, environ);
Expand All @@ -241,8 +241,8 @@ Application::error_t Application::run(const char *args[])
const_cast<char *>("-batch"),
const_cast<char *>("-f"),
const_cast<char *>("-x"),
const_cast<char *>(gdb_run_file.c_str()),
const_cast<char *>(_exectuble_with_path.c_str()),
const_cast<char *>(gdb_run_file.c_str()),
const_cast<char *>(_exectuble_with_path.c_str()),
0};
spawn_ret= posix_spawnp(&_pid, "gdb", &file_actions, &spawnattr, argv, environ);
}
Expand Down Expand Up @@ -660,7 +660,7 @@ void Application::create_argv(const char *args[])
else if (_use_ptrcheck)
{
/*
valgrind --error-exitcode=1 --tool=exp-ptrcheck --log-file=
valgrind --error-exitcode=1 --tool=exp-ptrcheck --log-file=
*/
_argc+= 4;
}
Expand Down Expand Up @@ -723,7 +723,7 @@ void Application::create_argv(const char *args[])
else if (_use_ptrcheck)
{
/*
valgrind --error-exitcode=1 --tool=exp-ptrcheck --log-file=
valgrind --error-exitcode=1 --tool=exp-ptrcheck --log-file=
*/
built_argv[x++]= strdup("valgrind");
built_argv[x++]= strdup("--error-exitcode=1");
Expand Down Expand Up @@ -813,12 +813,12 @@ int exec_cmdline(const std::string& command, const char *args[], bool use_libtoo
return int(app.wait(false));
}

const char *gearmand_binary()
const char *gearmand_binary()
{
return GEARMAND_BINARY;
}

const char *drizzled_binary()
const char *drizzled_binary()
{
return DRIZZLED_BINARY;
}
Expand Down
5 changes: 3 additions & 2 deletions util/log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <cerrno>
#include <cstdarg>
#include <cstdio>
#include <cstring>
#include <fcntl.h>
#include <iostream>
#include <string>
Expand Down Expand Up @@ -113,8 +114,8 @@ struct log_info_st
{
char buffer[1024];
char *getcwd_ret= getcwd(buffer, sizeof(buffer));
syslog(LOG_ERR, "Could not open log file \"%.*s\", from \"%s\", open failed with (%s)",
int(filename.size()), filename.c_str(),
syslog(LOG_ERR, "Could not open log file \"%.*s\", from \"%s\", open failed with (%s)",
int(filename.size()), filename.c_str(),
getcwd_ret,
strerror(errno));
}
Expand Down

0 comments on commit 7e14216

Please sign in to comment.