Commit 3ca572a7 authored by brendan's avatar brendan
Browse files

add unistd.h header for sleep()

shout_get_connected never returns BUSY (maybe it should?), so the loop was using the wrong condition.

svn path=/icecast/trunk/libshout/; revision=8550
parent 25020921
......@@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <shout/shout.h>
......@@ -64,8 +65,10 @@ int main()
ret = shout_open(shout);
if (ret == SHOUTERR_SUCCESS)
ret = SHOUTERR_CONNECTED;
else if (ret == SHOUTERR_BUSY)
ret = SHOUTERR_UNCONNECTED;
while (ret == SHOUTERR_BUSY) {
while (ret == SHOUTERR_UNCONNECTED) {
printf("Connection pending. Sleeping...\n");
sleep(1);
ret = shout_get_connected(shout);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment