aboutsummaryrefslogtreecommitdiffstats
path: root/src/stored_playlist.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-07-25 11:09:13 +0200
committerMax Kellermann <max@duempel.org>2010-07-25 12:01:59 +0200
commite4b7a113fded192d2ad31b68a87cf444f206a04e (patch)
treee1babf84c86d89469597058521ee72e48df85dfd /src/stored_playlist.c
parent7820ebb82ea66619ae72caf3bdeb7fd16d035fdd (diff)
downloadmpd-e4b7a113fded192d2ad31b68a87cf444f206a04e.tar.gz
mpd-e4b7a113fded192d2ad31b68a87cf444f206a04e.tar.xz
mpd-e4b7a113fded192d2ad31b68a87cf444f206a04e.zip
database, ...: remove EINTR checks after stdio calls
MPD doesn't have child processes anymore, and thus we're not expecting to receive SIGCHLD very often. Since hard disk access isn't interrupted by signals anyway, we don't need those excessive checks.
Diffstat (limited to 'src/stored_playlist.c')
-rw-r--r--src/stored_playlist.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/stored_playlist.c b/src/stored_playlist.c
index 36a899034..cd2818522 100644
--- a/src/stored_playlist.c
+++ b/src/stored_playlist.c
@@ -160,7 +160,7 @@ spl_save(GPtrArray *list, const char *utf8path)
if (path_fs == NULL)
return PLAYLIST_RESULT_BAD_NAME;
- while (!(file = fopen(path_fs, "w")) && errno == EINTR);
+ file = fopen(path_fs, "w");
g_free(path_fs);
if (file == NULL)
return PLAYLIST_RESULT_ERRNO;
@@ -170,7 +170,7 @@ spl_save(GPtrArray *list, const char *utf8path)
playlist_print_uri(file, uri);
}
- while (fclose(file) != 0 && errno == EINTR);
+ fclose(file);
return PLAYLIST_RESULT_SUCCESS;
}
@@ -189,7 +189,7 @@ spl_load(const char *utf8path)
if (path_fs == NULL)
return NULL;
- while (!(file = fopen(path_fs, "r")) && errno == EINTR);
+ file = fopen(path_fs, "r");
g_free(path_fs);
if (file == NULL)
return NULL;
@@ -227,7 +227,7 @@ spl_load(const char *utf8path)
break;
}
- while (fclose(file) && errno == EINTR);
+ fclose(file);
return list;
}
@@ -313,12 +313,12 @@ spl_clear(const char *utf8path)
if (path_fs == NULL)
return PLAYLIST_RESULT_BAD_NAME;
- while (!(file = fopen(path_fs, "w")) && errno == EINTR);
+ file = fopen(path_fs, "w");
g_free(path_fs);
if (file == NULL)
return PLAYLIST_RESULT_ERRNO;
- while (fclose(file) != 0 && errno == EINTR);
+ fclose(file);
idle_add(IDLE_STORED_PLAYLIST);
return PLAYLIST_RESULT_SUCCESS;
@@ -393,26 +393,26 @@ spl_append_song(const char *utf8path, struct song *song)
if (path_fs == NULL)
return PLAYLIST_RESULT_BAD_NAME;
- while (!(file = fopen(path_fs, "a")) && errno == EINTR);
+ file = fopen(path_fs, "a");
g_free(path_fs);
if (file == NULL)
return PLAYLIST_RESULT_ERRNO;
if (fstat(fileno(file), &st) < 0) {
int save_errno = errno;
- while (fclose(file) != 0 && errno == EINTR);
+ fclose(file);
errno = save_errno;
return PLAYLIST_RESULT_ERRNO;
}
if (st.st_size / (MPD_PATH_MAX + 1) >= (off_t)playlist_max_length) {
- while (fclose(file) != 0 && errno == EINTR);
+ fclose(file);
return PLAYLIST_RESULT_TOO_LARGE;
}
playlist_print_song(file, song);
- while (fclose(file) != 0 && errno == EINTR);
+ fclose(file);
idle_add(IDLE_STORED_PLAYLIST);
return PLAYLIST_RESULT_SUCCESS;