Commit 34a0d59b authored by Tristan Matthews's avatar Tristan Matthews
Browse files

daemon: fixed prints in main

parent 378de489
...@@ -113,14 +113,14 @@ main (int argc, char **argv) ...@@ -113,14 +113,14 @@ main (int argc, char **argv)
if (fp) { // PID file exists. Check the former process still alive or not. If alive, give user a hint. if (fp) { // PID file exists. Check the former process still alive or not. If alive, give user a hint.
int oldPid; int oldPid;
if (fscanf(fp, "%d", &oldPid) != 1) { if (fscanf(fp, "%d", &oldPid) != 1) {
fprintf(stderr, "Couldn't read pidfile %s\n", pidfile.c_str()); std::cerr << "Couldn't read pidfile " << pidfile << std::endl;
return 1; return 1;
} }
fclose (fp); fclose (fp);
if (kill (oldPid, 0) == 0) { if (kill (oldPid, 0) == 0) {
fprintf (stderr, "There is already a sflphoned daemon running in the system. Starting Failed."); std::cerr << "There is already a sflphoned daemon running in the system. Starting Failed." << std::endl;
return 1; return 1;
} }
} }
...@@ -140,11 +140,11 @@ main (int argc, char **argv) ...@@ -140,11 +140,11 @@ main (int argc, char **argv)
try { try {
Manager::instance().init(); Manager::instance().init();
} catch (std::exception &e) { } catch (const std::exception &e) {
std::cerr << e.what() << std::endl; std::cerr << e.what() << std::endl;
return 1; return 1;
} catch (...) { } catch (...) {
fprintf (stderr, "An exception occured when initializing the system."); std::cerr << "An exception occured when initializing the system." << std::endl;
return 1; return 1;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment