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.
} while (err == -1 && errno == EINTR);
if (err == -1) {
- perror("waitpid()");
+ log_perror("waitpid()");
return false;
}
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);