aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-05-17 11:56:14 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-05-17 11:56:14 +0000
commit0db46f05923f4dec3a2986b0fb01953429e3326d (patch)
tree37169dff64f89a2ebe1a2b6eb8472fa107cf78c8
parentb2af230b5eb7e14ee5673c156c13368570d51de1 (diff)
downloadmpd-0db46f05923f4dec3a2986b0fb01953429e3326d.tar.gz
mpd-0db46f05923f4dec3a2986b0fb01953429e3326d.tar.xz
mpd-0db46f05923f4dec3a2986b0fb01953429e3326d.zip
fix bug where db_update wasn't being set in readDirectoryDB
git-svn-id: https://svn.musicpd.org/mpd/trunk@1037 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--src/directory.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/directory.c b/src/directory.c
index 095023f0f..ff07e6bd6 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -157,16 +157,10 @@ void directory_sigChldHandler(int pid, int status) {
void readDirectoryDBIfUpdateIsFinished() {
if(directory_reReadDB && 0==directory_updatePid) {
- struct stat st;
-
DEBUG("readDirectoryDB since update finished successfully\n");
readDirectoryDB();
incrPlaylistVersion();
directory_reReadDB = 0;
-
- if(stat(directory_db,&st)==0) {
- directory_dbModTime = st.st_mtime;
- }
}
}
@@ -896,6 +890,7 @@ int writeDirectoryDB() {
int readDirectoryDB() {
FILE * fp;
+ struct stat st;
if(!mp3rootDirectory) mp3rootDirectory = newDirectory(NULL);
while(!(fp=fopen(directory_db,"r")) && errno==EINTR);
@@ -975,6 +970,8 @@ int readDirectoryDB() {
stats.numberOfSongs = countSongsIn(stderr,NULL);
stats.dbPlayTime = sumSongTimesIn(stderr,NULL);
+ if(stat(directory_db,&st)==0) directory_dbModTime = st.st_mtime;
+
return 0;
}