aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-04-13 16:46:11 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-04-13 16:46:11 +0000
commitacf0e147c25d93d9434bb279ae422cb4e62c1f7e (patch)
treeef923e4cec52fe1739f035d6a29f7f4ffa021c16 /src/directory.c
parent00c25b772edae62965b1615125b057f5986d18c2 (diff)
downloadmpd-acf0e147c25d93d9434bb279ae422cb4e62c1f7e.tar.gz
mpd-acf0e147c25d93d9434bb279ae422cb4e62c1f7e.tar.xz
mpd-acf0e147c25d93d9434bb279ae422cb4e62c1f7e.zip
when doing signal functions (like sigaction) make sure it wasn't interrupted by a signal (errno==EINTR)
git-svn-id: https://svn.musicpd.org/mpd/trunk@729 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/directory.c')
-rw-r--r--src/directory.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/directory.c b/src/directory.c
index b4634c42f..8a193d5a2 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -31,6 +31,7 @@
#include "volume.h"
#include "mpd_types.h"
#include "sig_handlers.h"
+#include "player.h"
#include <string.h>
#include <sys/types.h>
@@ -101,6 +102,10 @@ Directory * getDirectory(char * name);
Song * getSongDetails(char * file, char ** shortnameRet,
Directory ** directoryRet);
+void clearUpdatePid() {
+ directory_updatePid = 0;
+}
+
int isUpdatingDB() {
if(directory_updatePid>0 || directory_reReadDB) {
return directory_updateJobId;
@@ -120,7 +125,7 @@ void directory_sigChldHandler(int pid, int status) {
"updated db succesffully\n");
directory_reReadDB = 1;
}
- directory_updatePid = 0;
+ clearUpdatePid();
}
}
@@ -144,8 +149,10 @@ int updateInit(FILE * fp, List * pathList) {
blockSignals();
directory_updatePid = fork();
if(directory_updatePid==0) {
- unblockSignals();
/* child */
+ clearPlayerPid();
+
+ unblockSignals();
finishSigHandlers();
close(listenSocket);