diff --git a/daemon/src/main.cpp b/daemon/src/main.cpp index b63375421a58e5e557bcb23bc87b2fc504b24b39..9ea32a5c8ad61fcebc5b50400738fcaa0a44a6a0 100644 --- a/daemon/src/main.cpp +++ b/daemon/src/main.cpp @@ -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. int oldPid; 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; } fclose (fp); 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; } } @@ -140,11 +140,11 @@ main (int argc, char **argv) try { Manager::instance().init(); - } catch (std::exception &e) { + } catch (const std::exception &e) { std::cerr << e.what() << std::endl; return 1; } catch (...) { - fprintf (stderr, "An exception occured when initializing the system."); + std::cerr << "An exception occured when initializing the system." << std::endl; return 1; }