From 34a0d59b4765788184431d08a808d4ef9e77b5b6 Mon Sep 17 00:00:00 2001 From: Tristan Matthews <tristan.matthews@savoirfairelinux.com> Date: Thu, 8 Sep 2011 15:56:50 -0400 Subject: [PATCH] daemon: fixed prints in main --- daemon/src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/src/main.cpp b/daemon/src/main.cpp index b63375421a..9ea32a5c8a 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; } -- GitLab