Changeset - 2caa10e82702
[Not reviewed]
0 2 0
Jan Kaluza - 13 years ago 2012-08-06 15:37:39
hanzz.k@gmail.com
set MALLOC_CHECK_=2 in spectrum2 main process
2 files changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
spectrum/src/main.cpp
Show inline comments
 
@@ -116,24 +116,26 @@ static void daemonize(const char *cwd, const char *lock_file) {
 
#endif
 

	
 
int main(int argc, char **argv)
 
{
 
	Config config(argc, argv);
 

	
 
	boost::program_options::variables_map vm;
 
	bool no_daemon = false;
 
	std::string config_file;
 
	std::string jid;
 

	
 
	setlocale(LC_ALL, "");
 
	putenv("MALLOC_CHECK_=2");
 
	putenv("MALLOC_PERTURB_=B");
 

	
 
#ifndef WIN32
 
	if (signal(SIGINT, spectrum_sigint_handler) == SIG_ERR) {
 
		std::cout << "SIGINT handler can't be set\n";
 
		return -1;
 
	}
 

	
 
	if (signal(SIGTERM, spectrum_sigterm_handler) == SIG_ERR) {
 
		std::cout << "SIGTERM handler can't be set\n";
 
		return -1;
 
	}
 
#endif
spectrum_manager/src/main.cpp
Show inline comments
 
#include "managerconfig.h"
 
#include "transport/config.h"
 
#include "transport/protocol.pb.h"
 
#include "Swiften/Swiften.h"
 
#include "Swiften/EventLoop/SimpleEventLoop.h"
 
 
#include <boost/foreach.hpp>
 
#include <iostream>
 
#include <fstream>
 
#include <iterator>
 
#include <algorithm>
 
#include <boost/filesystem.hpp>
 
#include <cstdlib>
 
#include "signal.h"
 
#include "sys/wait.h"
 
 
#define WRAP(MESSAGE, TYPE) 	pbnetwork::WrapperMessage wrap; \
 
	wrap.set_type(TYPE); \
 
	wrap.set_payload(MESSAGE); \
 
	wrap.SerializeToString(&MESSAGE);
 
 
 
using namespace Transport;
 
 
using namespace boost::filesystem;
 
@@ -559,24 +560,27 @@ int main(int argc, char **argv)
 
	}
 
 
	if (!config.load(config_file)) {
 
		std::cerr << "Can't load configuration file.\n";
 
		return 4;
 
	}
 
 
	if (command.empty()) {
 
		std::cout << desc << "\n";
 
		return 1;
 
	}
 
 
	putenv("MALLOC_CHECK_=2");
 
	putenv("MALLOC_PERTURB_=B");
 
 
	if (command[0] == "start") {
 
		start_instances(&config);
 
	}
 
	else if (command[0] == "stop") {
 
		stop_instances(&config);
 
	}
 
	else if (command[0] == "status") {
 
		return show_status(&config);
 
	}
 
	else if (command[0] == "list") {
 
		show_list(&config);
 
	}
0 comments (0 inline, 0 general)