FatalError: new library to replace mpd_error.h

This commit is contained in:
Max Kellermann
2013-08-07 09:35:30 +02:00
parent 67e44b0f2c
commit a27d105dcd
15 changed files with 222 additions and 76 deletions

View File

@@ -21,6 +21,7 @@
#include "Log.hxx"
#include "conf.h"
#include "fd_util.h"
#include "FatalError.hxx"
#include "mpd_error.h"
#include <assert.h>
@@ -60,9 +61,9 @@ static void redirect_logs(int fd)
{
assert(fd >= 0);
if (dup2(fd, STDOUT_FILENO) < 0)
MPD_ERROR("problems dup2 stdout : %s\n", strerror(errno));
FatalSystemError("Failed to dup2 stdout");
if (dup2(fd, STDERR_FILENO) < 0)
MPD_ERROR("problems dup2 stderr : %s\n", strerror(errno));
FatalSystemError("Failed to dup2 stderr");
}
static const char *log_date(void)