- if ((tmp_fd = g_file_open_tmp ("vik-bing.XXXXXX", &tmpname, NULL)) == -1) {
- g_critical(_("couldn't open temp file"));
- return -1;
- }
-
- tmp_file = fdopen(tmp_fd, "r+");
- uri = g_strdup_printf(URL_ATTR_FMT, priv->api_key);
-
- /* TODO: curl may not be available */
- if (curl_download_uri(uri, tmp_file, vik_map_source_default_get_download_options(VIK_MAP_SOURCE_DEFAULT(self)), 0, NULL)) { /* error */
- fclose(tmp_file);
- tmp_file = NULL;
- ret = -1;
- goto done;
- }
-
- fclose(tmp_file);
- tmp_file = NULL;