Use <= when comparing (current time - start time) to a timeout. This way

if the clock ticks right after we get the start time and the timeout is
only one second, we'll still wait a full second instead of returning
immediately.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6557 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
J. Alexander Treuman 2007-06-12 18:33:26 +00:00
parent 6f2be47270
commit 8de17dbed0
1 changed files with 2 additions and 2 deletions

View File

@ -453,7 +453,7 @@ static int myShout_openShoutConn(AudioOutput * audioOutput)
int state;
if (sd->connAttempts != 0 &&
(t - sd->lastAttempt) < CONN_ATTEMPT_INTERVAL) {
(t - sd->lastAttempt) <= CONN_ATTEMPT_INTERVAL) {
return -1;
}
@ -462,7 +462,7 @@ static int myShout_openShoutConn(AudioOutput * audioOutput)
state = shout_open(sd->shoutConn);
while (state == SHOUTERR_BUSY && (t - sd->lastAttempt) < sd->timeout) {
while (state == SHOUTERR_BUSY && (t - sd->lastAttempt) <= sd->timeout) {
my_usleep(10000);
state = shout_get_connected(sd->shoutConn);
t = time(NULL);