diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-04-11 03:12:00 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-04-11 03:12:00 +0000 |
commit | c77011bf2a2521b97024e0fd1ca48c5a73439175 (patch) | |
tree | bd84660750c55d739d729316ed2b76699c0e772d /src/directory.c | |
parent | 4cfd77be95658167467163bf5c87fd5957ee71f1 (diff) | |
download | mpd-c77011bf2a2521b97024e0fd1ca48c5a73439175.tar.gz mpd-c77011bf2a2521b97024e0fd1ca48c5a73439175.tar.xz mpd-c77011bf2a2521b97024e0fd1ca48c5a73439175.zip |
update job id stuff
git-svn-id: https://svn.musicpd.org/mpd/trunk@673 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/directory.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/directory.c b/src/directory.c index 7ecc5bd62..17d91631c 100644 --- a/src/directory.c +++ b/src/directory.c @@ -29,6 +29,7 @@ #include "listen.h" #include "interface.h" #include "volume.h" +#include "mpd_types.h" #include <string.h> #include <sys/types.h> @@ -72,6 +73,8 @@ char directorydb[MAXPATHLEN+1]; int directory_updatePid = 0; +mpd_uint16 directory_updateJobId = 0; + DirectoryList * newDirectoryList(); int addToDirectory(Directory * directory, char * shortname, char * name); @@ -89,7 +92,7 @@ void deleteEmptyDirectoriesInDirectory(Directory * directory); int addSubDirectoryToDirectory(Directory * directory, char * shortname, char * name); int isUpdatingDB() { - if(directory_updatePid>0) return 1; + if(directory_updatePid>0) return directory_updateJobId; return 0; } @@ -143,7 +146,11 @@ int updateInit(FILE * fp) { return -1; } - DEBUG("updateInit: fork()'d update child\n"); + directory_updateJobId++; + if(directory_updateJobId > 1<<15) directory_updateJobId = 1; + DEBUG("updateInit: fork()'d update child for update job id %i\n", + (int)directory_updateJobId); + myfprintf(fp,"updating_db: %i\n",(int)directory_updateJobId); return 0; } |