From db1c0061b02e9907c2c302d01499a33931fb0eb6 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Thu, 6 Aug 2009 16:35:06 +0200 Subject: [PATCH] Fix: rename timeout in mpdcode to prevent clashes with timeout in ncurses --- src/libmpdclient.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libmpdclient.c b/src/libmpdclient.c index 791ad895..acc2c2e1 100644 --- a/src/libmpdclient.c +++ b/src/libmpdclient.c @@ -122,7 +122,7 @@ static int do_connect_fail(mpd_Connection *connection, #ifdef MPD_HAVE_GAI static int mpd_connect(mpd_Connection *connection, const char *host, int port, - float timeout) + float mpd_timeout) { int error; char service[INTLEN + 1]; @@ -170,7 +170,7 @@ static int mpd_connect(mpd_Connection *connection, const char *host, int port, return -1; } - mpd_setConnectionTimeout(connection, timeout); + mpd_setConnectionTimeout(connection, mpd_timeout); /* connect stuff */ 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 */ static int mpd_connect(mpd_Connection *connection, const char *host, int port, - float timeout) + float mpd_timeout) { struct hostent he, *he_res = 0; int he_errno; @@ -249,7 +249,7 @@ static int mpd_connect(mpd_Connection *connection, const char *host, int port, return -1; } - mpd_setConnectionTimeout(connection, timeout); + mpd_setConnectionTimeout(connection, mpd_timeout); /* connect stuff */ if (do_connect_fail(connection, dest, destlen)) { @@ -320,11 +320,11 @@ static void mpd_freeReturnElement(mpd_ReturnElement *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_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, @@ -361,7 +361,7 @@ static int mpd_parseWelcome(mpd_Connection *connection, const char *host, 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; char *rt; @@ -387,7 +387,7 @@ mpd_Connection *mpd_newConnection(const char *host, int port, float timeout) return connection; } - if (mpd_connect(connection, host, port, timeout) < 0) { + if (mpd_connect(connection, host, port, mpd_timeout) < 0) { return connection; }