From 785cdb0114f8cf534ef93e413e49fbfb62521a67 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Fri, 2 Apr 2004 23:34:16 +0000 Subject: use EXIT_SUCCESS and EXIT_FAILURE git-svn-id: https://svn.musicpd.org/mpd/trunk@591 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/playlist.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/playlist.c') diff --git a/src/playlist.c b/src/playlist.c index 62482a9df..957a4a748 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -108,7 +108,7 @@ void initPlaylist() { if(*test!='\0') { ERROR("max playlist length \"%s\" is not an integer\n", (getConf())[CONF_MAX_PLAYLIST_LENGTH]); - exit(-1); + exit(EXIT_FAILURE); } if(strcmp("yes",(getConf())[CONF_SAVE_ABSOLUTE_PATHS_IN_PLAYLISTS]) @@ -123,7 +123,7 @@ void initPlaylist() { ERROR("save_absolute_paths_in_playlist \"%s\" is not yes or " "no\n", (getConf())[CONF_SAVE_ABSOLUTE_PATHS_IN_PLAYLISTS]); - exit(-1); + exit(EXIT_FAILURE); } playlist.songs = malloc(sizeof(Song *)*playlist_max_length); @@ -228,14 +228,14 @@ void loadPlaylistFromStateFile(FILE * fp, char * buffer, int state, int current, if(!myFgets(buffer,PLAYLIST_BUFFER_SIZE,fp)) { ERROR("error parsing state file \"%s\"\n",playlist_stateFile); - exit(-1); + exit(EXIT_FAILURE); } while(strcmp(buffer,PLAYLIST_STATE_FILE_PLAYLIST_END)) { song = atoi(strtok(buffer,":")); if(!(temp = strtok(NULL,""))) { ERROR("error parsing state file \"%s\"\n", playlist_stateFile); - exit(-1); + exit(EXIT_FAILURE); } if(addToPlaylist(stderr,temp)==0 && current==song) { if(state!=PLAYER_STATE_STOP) { @@ -252,7 +252,7 @@ void loadPlaylistFromStateFile(FILE * fp, char * buffer, int state, int current, if(!myFgets(buffer,PLAYLIST_BUFFER_SIZE,fp)) { ERROR("error parsing state file \"%s\"\n", playlist_stateFile); - exit(-1); + exit(EXIT_FAILURE); } } } @@ -270,14 +270,14 @@ void readPlaylistState() { if(!S_ISREG(st.st_mode)) { ERROR("state file \"%s\" is not a regular " "file\n",playlist_stateFile); - exit(-1); + exit(EXIT_FAILURE); } fp = fopen(playlist_stateFile,"r"); if(!fp) { ERROR("problems opening state file \"%s\" for " "reading\n",playlist_stateFile); - exit(-1); + exit(EXIT_FAILURE); } while(myFgets(buffer,PLAYLIST_BUFFER_SIZE,fp)) { @@ -329,7 +329,7 @@ void readPlaylistState() { ERROR("error parsing state " "file \"%s\"\n", playlist_stateFile); - exit(-1); + exit(EXIT_FAILURE); } current = atoi(&(buffer [strlen(PLAYLIST_STATE_FILE_CURRENT)])); -- cgit v1.2.3