mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-13 11:15:27 +00:00
Fix: rename timeout in mpdcode to prevent clashes with timeout in ncurses
This commit is contained in:
parent
157537fc30
commit
db1c0061b0
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user