tSet ret to -1 on error - spoon - dwm status utility (2f30 fork)
HTML git clone git://src.adamsgaard.dk/spoon
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
DIR commit a1083a672848a04e871ce0e8ad96c367e55549e5
DIR parent a0dad9bb5687f35a14c415828a24d84f1ffc1fbe
HTML Author: sin <sin@2f30.org>
Date: Mon, 26 Sep 2016 16:51:31 +0100
Set ret to -1 on error
Diffstat:
M spoon.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
DIR diff --git a/spoon.c b/spoon.c
t@@ -54,7 +54,7 @@ mpdread(char *buf, size_t len)
if (conn == NULL)
return -1;
if (mpd_connection_get_error(conn) != MPD_ERROR_SUCCESS) {
- warnx("cannot connect to mpd");
+ ret = -1;
goto out;
}
}
t@@ -90,6 +90,7 @@ mpdread(char *buf, size_t len)
}
return 0;
out:
+ warnx("failed to talk to mpd");
mpd_connection_free(conn);
conn = NULL;
return ret;