]> git.street.me.uk Git - andy/viking.git/commitdiff
[QA] Coverity: Unchecked return value from library
authorRob Norris <rw_norris@hotmail.com>
Wed, 4 Nov 2015 20:56:59 +0000 (20:56 +0000)
committerRob Norris <rw_norris@hotmail.com>
Sun, 8 Nov 2015 17:26:07 +0000 (17:26 +0000)
Explicitly ignore return values - when removing temporary generate files

CID#131383
CID#131382
CID#131381
CID#34570
CID#34563
CID#34561
CID#34557
CID#34555
CID#34546

src/babel.c
src/bingmapsource.c
src/datasource_geojson.c
src/download.c

index 3f13ab37ae612a077960067851ae7cfbaeaca52a..64b89aac8d5de85e66665c7b990bba90ef9ab60f 100644 (file)
@@ -317,7 +317,7 @@ gboolean a_babel_convert_from_filter( VikTrwLayer *vt, const char *babelargs, co
           g_strfreev(sub_filters);
     } else
       g_critical("gpsbabel not found in PATH");
-    g_remove(name_dst);
+    (void)g_remove(name_dst);
     g_free(name_dst);
   }
 
@@ -367,7 +367,7 @@ gboolean a_babel_convert_from_shellcommand ( VikTrwLayer *vt, const char *input_
     ret = babel_general_convert_from ( vt, cb, args, name_dst, user_data );
     g_free ( args );
     g_free ( shell_command );
-    g_remove(name_dst);
+    (void)g_remove(name_dst);
     g_free(name_dst);
   }
 
@@ -407,7 +407,7 @@ gboolean a_babel_convert_from_url_filter ( VikTrwLayer *vt, const char *url, con
   if ((fd_src = g_file_open_tmp("tmp-viking.XXXXXX", &name_src, NULL)) >= 0) {
     g_debug ("%s: temporary file: %s", __FUNCTION__, name_src);
     close(fd_src);
-    g_remove(name_src);
+    (void)g_remove(name_src);
 
     fetch_ret = a_http_download_get_url(url, "", name_src, &myoptions, NULL);
     if (fetch_ret == DOWNLOAD_SUCCESS) {
@@ -425,7 +425,7 @@ gboolean a_babel_convert_from_url_filter ( VikTrwLayer *vt, const char *url, con
         }
       }
     }
-    util_remove(name_src);
+    (void)util_remove(name_src);
     g_free(babelargs);
     g_free(name_src);
   }
@@ -522,7 +522,7 @@ gboolean a_babel_convert_to( VikTrwLayer *vt, VikTrack *track, const char *babel
       g_strfreev(sub_args);
     } else
       g_critical("gpsbabel not found in PATH");
-    g_remove(name_src);
+    (void)g_remove(name_src);
     g_free(name_src);
   }
 
index 917d5302586e4290d0f4dbb43f3ea6af9d4e6d91..17a083df8d477df9c0d61c7fea6f1907332b7325 100644 (file)
@@ -470,7 +470,7 @@ _load_attributions ( BingMapSource *self )
 done:
        priv->loading_attributions = FALSE;
        g_free(uri);
-       g_remove(tmpname);
+       (void)g_remove(tmpname);
        g_free(tmpname);
        return ret;
 }
index 054beb79ade8ffe376e7bc7de5c42a286427b0ff..9d6fef1f2d79befb849184d0ae7b3b2195a1cf42 100644 (file)
@@ -145,7 +145,7 @@ static gboolean datasource_geojson_process ( VikTrwLayer *vtl, ProcessOptions *p
                        // Important that this process is run in the main thread
                        vik_window_open_file ( adw->vw, gpx_filename, FALSE );
                        // Delete the temporary file
-                       g_remove (gpx_filename);
+                       (void)g_remove (gpx_filename);
                        g_free (gpx_filename);
                }
                else {
index e928a74b5c60be4f6539a6e5ca705e9c8d8cc1e6..9ded2f2e8dd51c2499da0c6ec1714e0835ff4258 100644 (file)
@@ -375,7 +375,7 @@ static DownloadResult_t download( const char *hostname, const char *uri, const c
   }
 
   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
@@ -447,7 +447,7 @@ gchar *a_download_uri_to_tmp_file ( const gchar *uri, DownloadMapOptions *option
   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;
   }