1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-27 17:18:33 +00:00

Fix: rename timeout in mpdcode to prevent clashes with timeout in ncurses

This commit is contained in:
Nikolas Garofil 2009-08-06 16:35:06 +02:00
parent 157537fc30
commit db1c0061b0

View File

@ -122,7 +122,7 @@ static int do_connect_fail(mpd_Connection *connection,
#ifdef MPD_HAVE_GAI #ifdef MPD_HAVE_GAI
static int mpd_connect(mpd_Connection *connection, const char *host, int port, static int mpd_connect(mpd_Connection *connection, const char *host, int port,
float timeout) float mpd_timeout)
{ {
int error; int error;
char service[INTLEN + 1]; char service[INTLEN + 1];
@ -170,7 +170,7 @@ static int mpd_connect(mpd_Connection *connection, const char *host, int port,
return -1; return -1;
} }
mpd_setConnectionTimeout(connection, timeout); mpd_setConnectionTimeout(connection, mpd_timeout);
/* connect stuff */ /* connect stuff */
if (do_connect_fail(connection, res->ai_addr, res->ai_addrlen)) { if (do_connect_fail(connection, res->ai_addr, res->ai_addrlen)) {
@ -196,7 +196,7 @@ static int mpd_connect(mpd_Connection *connection, const char *host, int port,
} }
#else /* !MPD_HAVE_GAI */ #else /* !MPD_HAVE_GAI */
static int mpd_connect(mpd_Connection *connection, const char *host, int port, static int mpd_connect(mpd_Connection *connection, const char *host, int port,
float timeout) float mpd_timeout)
{ {
struct hostent he, *he_res = 0; struct hostent he, *he_res = 0;
int he_errno; int he_errno;
@ -249,7 +249,7 @@ static int mpd_connect(mpd_Connection *connection, const char *host, int port,
return -1; return -1;
} }
mpd_setConnectionTimeout(connection, timeout); mpd_setConnectionTimeout(connection, mpd_timeout);
/* connect stuff */ /* connect stuff */
if (do_connect_fail(connection, dest, destlen)) { if (do_connect_fail(connection, dest, destlen)) {
@ -320,11 +320,11 @@ static void mpd_freeReturnElement(mpd_ReturnElement *re)
free(re); free(re);
} }
void mpd_setConnectionTimeout(mpd_Connection *connection, float timeout) void mpd_setConnectionTimeout(mpd_Connection *connection, float mpd_timeout)
{ {
connection->timeout.tv_sec = (int) timeout; connection->timeout.tv_sec = (int) timeout;
connection->timeout.tv_usec = connection->timeout.tv_usec =
(int) ((timeout - connection->timeout.tv_sec) * 1e6 + 0.5); (int) ((mpd_timeout - connection->timeout.tv_sec) * 1e6 + 0.5);
} }
static int mpd_parseWelcome(mpd_Connection *connection, const char *host, static int mpd_parseWelcome(mpd_Connection *connection, const char *host,
@ -361,7 +361,7 @@ static int mpd_parseWelcome(mpd_Connection *connection, const char *host,
return 0; return 0;
} }
mpd_Connection *mpd_newConnection(const char *host, int port, float timeout) mpd_Connection *mpd_newConnection(const char *host, int port, float mpd_timeout)
{ {
int err; int err;
char *rt; char *rt;
@ -387,7 +387,7 @@ mpd_Connection *mpd_newConnection(const char *host, int port, float timeout)
return connection; return connection;
} }
if (mpd_connect(connection, host, port, timeout) < 0) { if (mpd_connect(connection, host, port, mpd_timeout) < 0) {
return connection; return connection;
} }