aboutsummaryrefslogtreecommitdiffstats
path: root/src/update.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-08 11:06:26 +0200
committerEric Wong <normalperson@yhbt.net>2008-10-11 19:21:48 -0700
commitaae48c97fb3d2b0140daa8e49459a7afe3488683 (patch)
tree0e250f502f03f005ecb0f5cd7156c6819b5ef486 /src/update.c
parente4ca5f5b5c051f98b90070303a83f53b68851034 (diff)
downloadmpd-aae48c97fb3d2b0140daa8e49459a7afe3488683.tar.gz
mpd-aae48c97fb3d2b0140daa8e49459a7afe3488683.tar.xz
mpd-aae48c97fb3d2b0140daa8e49459a7afe3488683.zip
song: song_file_update() returns boolean
Instead of returning 0 or -1, return true on success and false on failure. This seems more natural, and when the C library was designed, there was no "bool" data type. [ew: changing to bool semantics but sticking with integer type since bool is C99 and I don't require a C99 compiler, and I don't feel like writing compatibility wrappers to support it. _Bool is usually (always?) a signed int anyways. ]
Diffstat (limited to 'src/update.c')
-rw-r--r--src/update.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/update.c b/src/update.c
index e7a49e56e..594e7f48c 100644
--- a/src/update.c
+++ b/src/update.c
@@ -226,7 +226,7 @@ updateInDirectory(struct directory *directory, const char *name)
return UPDATE_RETURN_UPDATED;
} else if (st.st_mtime != song->mtime) {
LOG("updating %s\n", name);
- if (song_file_update(song) < 0)
+ if (!song_file_update(song))
delete_song(directory, song);
return UPDATE_RETURN_UPDATED;
}
@@ -405,7 +405,7 @@ static enum update_return updatePath(const char *utf8path)
isMusic(song_get_url(song, path_max_tmp), &mtime, 0)) {
if (song->mtime == mtime)
return UPDATE_RETURN_NOUPDATE;
- else if (song_file_update(song) == 0)
+ else if (song_file_update(song))
return UPDATE_RETURN_UPDATED;
else {
delete_song(parentDirectory, song);