mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
daemon: fixed prints in main
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user