Common subdirectories: ../WMxmms-0.1.4.orig/src/.xvpics and src/.xvpics diff -u ../WMxmms-0.1.4.orig/src/xmms_func.c src/xmms_func.c --- ../WMxmms-0.1.4.orig/src/xmms_func.c 2003-03-31 10:40:23.000000000 -0700 +++ src/xmms_func.c 2005-04-28 15:55:08.000000000 -0600 @@ -110,17 +110,39 @@ { char *command; int status; + int count = 0; + + if( xmms_remote_is_running(xmms_session) ) + { + fprintf(stderr, "XMMS is already running..."); + return; + } command=malloc(strlen(xmms_cmd)+5); sprintf(command, "%s &", xmms_cmd); + status = system(command); - if (status) - { - fprintf(stderr, "XMMS can't be launched, exiting..."); - exit(1); - } - while (!xmms_remote_is_running(xmms_session)) + + while (!xmms_remote_is_running(xmms_session) && count < 1800) { usleep(10000L); + count++; + if( (count % 60) == 0 ) + { + fprintf(stderr, + "There may be a problem starting XMMS, or the " + "XMMS remote is not running. Sleeping for 5 " + "seconds and checking for the remote again.\n"); + sleep(5); + } + } + + if( (count == 1800) && status){ + fprintf(stderr, + "status(%d) XMMS can't be launched, exiting...\n", + status); + exit(1); + } + free(command); }