Skip to content
Snippets Groups Projects
Commit 37350d89 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #6655: cleanup in main

parent d8b62f5f
No related branches found
No related tags found
No related merge requests found
......@@ -46,23 +46,15 @@
#include "audio/audiolayer.h"
using namespace ost;
/*
CommandOptionArg level (
"log-level", "l", "Log level (not yet implemented)"
);
*/
CommandOptionNoArg console (
ost::CommandOptionNoArg console (
"console", "c", "Log in console (instead of syslog)"
);
CommandOptionNoArg debug (
ost::CommandOptionNoArg debug (
"debug", "d", "Debug mode (more verbose)"
);
CommandOptionNoArg help (
ost::CommandOptionNoArg help (
"help", "h", "Print help"
);
......@@ -77,7 +69,7 @@ main (int argc, char **argv)
// makeCommandOptionParse allocates the object with operator new, so
// auto_ptr is fine in this context.
// TODO: This should eventually be replaced with std::unique_ptr for C++0x
std::auto_ptr<CommandOptionParse> args(makeCommandOptionParse (argc, argv, ""));
std::auto_ptr<ost::CommandOptionParse> args(ost::makeCommandOptionParse (argc, argv, ""));
printf ("SFLphone Daemon %s, by Savoir-Faire Linux 2004-2011\n", VERSION);
printf ("http://www.sflphone.org/\n");
......@@ -160,7 +152,7 @@ main (int argc, char **argv)
char *res;
res = fgets (cOldPid, 64, fp);
if (res == NULL) perror ("Error getting string from stream");
if (res == NULL) perror ("Error getting string from stream");
else {
fclose (fp);
......@@ -176,21 +168,10 @@ main (int argc, char **argv)
fputs (cPid , fp);
fclose (fp);
}
}
}
}
int sessionPort = 0;
if (argc == 2) {
char* ptrPort = strstr (argv[1], "--port=");
if (ptrPort != 0) {
sessionPort = atoi (ptrPort+7);
}
}
try {
// TODO Use $XDG_CONFIG_HOME to save the config file (which default to $HOME/.config)
Manager::instance().initConfigFile();
......@@ -209,5 +190,3 @@ main (int argc, char **argv)
return 0;
}
// EOF
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment