aboutsummaryrefslogtreecommitdiffstats
path: root/src/state_file.c
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2007-05-26 18:15:54 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2007-05-26 18:15:54 +0000
commitbba444524eca700970f69261bc470fb01a138222 (patch)
tree7d5e302586ed757a6eb3f71a27f84bba60383fd4 /src/state_file.c
parentdba45a59928301da0faa4ec679eb1a3a81d5fba5 (diff)
downloadmpd-bba444524eca700970f69261bc470fb01a138222.tar.gz
mpd-bba444524eca700970f69261bc470fb01a138222.tar.xz
mpd-bba444524eca700970f69261bc470fb01a138222.zip
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
Diffstat (limited to '')
-rw-r--r--src/state_file.c12
1 files changed, 4 insertions, 8 deletions
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);
}