]> git.sesse.net Git - cubemap/blobdiff - main.cpp
Replace all perror() calls with our own log calls.
[cubemap] / main.cpp
index 8825631771ffe80fe4ca3a7baa5261e2748f1083..4a5904b0715f1905817210138e3c9b7091329fae 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -197,14 +197,14 @@ bool dry_run_config(const std::string &argv0, const std::string &config_filename
        pid_t pid = fork();
        switch (pid) {
        case -1:
-               perror("fork()");
+               log_perror("fork()");
                free(argv0_copy);
                free(config_filename_copy);
                return false;
        case 0:
                // Child.
                execlp(argv0_copy, argv0_copy, "--test-config", config_filename_copy, NULL);
-               perror(argv0_copy);
+               log_perror(argv0_copy);
                _exit(1);
        default:
                // Parent.
@@ -221,7 +221,7 @@ bool dry_run_config(const std::string &argv0, const std::string &config_filename
        } while (err == -1 && errno == EINTR);
 
        if (err == -1) {
-               perror("waitpid()");
+               log_perror("waitpid()");
                return false;
        }       
 
@@ -402,7 +402,7 @@ start:
        for ( ;; ) {
                execlp(argv[0], argv[0], config_filename.c_str(), "--state", buf, NULL);
                open_logs(config.log_destinations);
-               perror("execlp");
+               log_perror("execlp");
                log(ERROR, "re-exec of %s failed. Waiting 0.2 seconds and trying again...", argv[0]);
                shut_down_logging();
                usleep(200000);