From ae33b348afa800447db9344cf6e5d082f1a1fcb3 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Sun, 11 Apr 2004 23:07:43 +0000 Subject: clean up signal handling using a polling method, from the genius that is mackstann git-svn-id: https://svn.musicpd.org/mpd/trunk@697 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/playlist.c | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'src/playlist.c') diff --git a/src/playlist.c b/src/playlist.c index 1985612a1..471c1b08e 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -102,8 +102,6 @@ void initPlaylist() { playlist.random = 0; playlist.queued = -1; - blockTermSignal(); - playlist_max_length = strtol((getConf())[CONF_MAX_PLAYLIST_LENGTH],&test,10); if(*test!='\0') { ERROR("max playlist length \"%s\" is not an integer\n", @@ -137,7 +135,6 @@ void initPlaylist() { playlist_stateFile = getConf()[CONF_STATE_FILE]; } - unblockTermSignal(); } void finishPlaylist() { @@ -152,10 +149,8 @@ int clearPlaylist(FILE * fp) { if(stopPlaylist(fp)<0) return -1; - blockTermSignal(); for(i=0;i=0) { @@ -552,8 +544,6 @@ int swapSongsInPlaylist(FILE * fp, int song1, int song2) { else if(playlist.current==song2) playlist.current = song1; } - unblockTermSignal(); - incrPlaylistVersion(); return 0; @@ -572,7 +562,6 @@ int deleteFromPlaylist(FILE * fp, int song) { return -1; } - blockTermSignal(); if(playlist_state==PLAYLIST_STATE_PLAY) { if(playlist.queued>=0 && (playlist.order[playlist.queued]==song || playlist.order[playlist.current]==song)) @@ -602,8 +591,6 @@ int deleteFromPlaylist(FILE * fp, int song) { playlist.songs[playlist.length-1] = NULL; playlist.length--; - unblockTermSignal(); - incrPlaylistVersion(); if(playlist_state!=PLAYLIST_STATE_STOP && playlist.current==songOrder) { @@ -820,7 +807,6 @@ int moveSongInPlaylist(FILE * fp, int from, int to) { return -1; } - blockTermSignal(); if(playlist_state==PLAYLIST_STATE_PLAY) { if(playlist.queued>=0) { @@ -866,8 +852,6 @@ int moveSongInPlaylist(FILE * fp, int from, int to) { playlist.current++; } - unblockTermSignal(); - incrPlaylistVersion(); return 0; @@ -878,7 +862,6 @@ void orderPlaylist() { playlist.current = playlist.order[playlist.current]; - blockTermSignal(); if(playlist_state==PLAYLIST_STATE_PLAY) { if(playlist.queued>=0) { lockPlaylistInteraction(); @@ -891,7 +874,6 @@ void orderPlaylist() { playlist.order[i] = i; } - unblockTermSignal(); } void swapOrder(int a, int b) { @@ -906,8 +888,6 @@ void randomizeOrder(int start,int end) { DEBUG("playlist: randomize from %i to %i\n",start,end); - blockTermSignal(); - if(playlist_state==PLAYLIST_STATE_PLAY) { if(playlist.queued>=start && playlist.queued<=end) { lockPlaylistInteraction(); @@ -923,7 +903,6 @@ void randomizeOrder(int start,int end) { swapOrder(i,ri); } - unblockTermSignal(); } int setPlaylistRandomStatus(FILE * fp, int status) { @@ -978,7 +957,6 @@ int shufflePlaylist(FILE * fp) { int ri; if(playlist.length>1) { - blockTermSignal(); if(playlist_state==PLAYLIST_STATE_PLAY) { lockPlaylistInteraction(); clearPlayerQueue(); @@ -999,7 +977,6 @@ int shufflePlaylist(FILE * fp) { ri = rand()%(playlist.length-1)+1; swapSongs(i,ri); } - unblockTermSignal(); incrPlaylistVersion(); } @@ -1068,7 +1045,6 @@ int savePlaylist(FILE * fp, char * utf8file) { return -1; } - while(!(fileP = fopen(actualFile,"w")) && errno==EINTR); if(fileP==NULL) { myfprintf(fp,"%s Problems opening file\n",COMMAND_RESPOND_ERROR); -- cgit v1.2.3