input/curl: set GError when init() fails

Let the caller know what happened, he's responsible for logging.
This commit is contained in:
Max Kellermann 2011-08-25 08:43:05 +02:00
parent 5bba2df526
commit 37c8f5c1da

View File

@ -118,8 +118,9 @@ input_curl_init(const struct config_param *param,
{
CURLcode code = curl_global_init(CURL_GLOBAL_ALL);
if (code != CURLE_OK) {
g_warning("curl_global_init() failed: %s\n",
curl_easy_strerror(code));
g_set_error(error_r, curl_quark(), code,
"curl_global_init() failed: %s\n",
curl_easy_strerror(code));
return false;
}