From bba444524eca700970f69261bc470fb01a138222 Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Sat, 26 May 2007 18:15:54 +0000 Subject: Changing all calls to ERROR() followed by exit(EXIT_FAILURE) with a single call to FATAL(). git-svn-id: https://svn.musicpd.org/mpd/trunk@6276 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/state_file.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/state_file.c') diff --git a/src/state_file.c b/src/state_file.c index 2e6f83047..1b0b41f1a 100644 --- a/src/state_file.c +++ b/src/state_file.c @@ -87,16 +87,13 @@ void read_state_file(void) DEBUG("failed to stat state file: %s\n", sfpath); return; } - if (!S_ISREG(st.st_mode)) { - ERROR("state file \"%s\" is not a regular file\n", sfpath); - exit(EXIT_FAILURE); - } + if (!S_ISREG(st.st_mode)) + FATAL("state file \"%s\" is not a regular file\n", sfpath); while (!(fp = fopen(sfpath, "r")) && errno == EINTR); if (mpd_unlikely(!fp)) { - ERROR("problems opening state file \"%s\" for reading: %s\n", + FATAL("problems opening state file \"%s\" for reading: %s\n", sfpath, strerror(errno)); - exit(EXIT_FAILURE); } for (i = 0; i < ARRAY_SIZE(sf_callbacks); i++) { sf_callbacks[i].reader(fp); @@ -108,7 +105,6 @@ void read_state_file(void) void mpd_noreturn state_file_fatal(void) { - ERROR("error parsing state file \"%s\"\n", sfpath); - exit(EXIT_FAILURE); + FATAL("error parsing state file \"%s\"\n", sfpath); } -- cgit v1.2.3