size_t nr;
memset(buf, 0, sizeof(buf));
- fgetpos(f, &pos);
+ if ( !fgetpos(f, &pos) )
+ return FALSE;
rewind(f);
nr = fread(buf, 1, sizeof(buf) - 1, f);
- fsetpos(f, &pos);
+ if ( !fgetpos(f, &pos) )
+ return FALSE;
for (bp = buf; (bp < (buf + sizeof(buf) - 1)) && (nr > (bp - buf)); bp++) {
if (!(isspace(*bp)))
break;
time_t tile_age = a_preferences_get(VIKING_PREFERENCES_NAMESPACE "download_tile_age")->u;
/* Get the modified time of this file */
struct stat buf;
- g_stat ( fn, &buf );
+ (void)g_stat ( fn, &buf );
time_t file_time = buf.st_mtime;
if ( (time(NULL) - file_time) < tile_age ) {
/* File cache is too recent, so return */
} else {
gchar *dir = g_path_get_dirname ( fn );
- g_mkdir_with_parents ( dir , 0777 );
+ if ( g_mkdir_with_parents ( dir , 0777 ) != 0)
+ g_warning ("%s: Failed to mkdir %s", __FUNCTION__, dir );
g_free ( dir );
}
}
if (ret == CURL_DOWNLOAD_NO_NEWER_FILE) {
- g_remove ( tmpfilename );
+ (void)g_remove ( tmpfilename );
#if GLIB_CHECK_VERSION(2,18,0)
g_utime ( fn, NULL ); /* update mtime of local copy */
#else
if ( curl_download_uri ( uri, tmp_file, options, NULL, NULL ) ) {
// error
fclose ( tmp_file );
- g_remove ( tmpname );
+ (void)g_remove ( tmpname );
g_free ( tmpname );
return NULL;
}