]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Mark with (void) the remove() function and other unchecked functions
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Wed, 5 Apr 2017 12:47:30 +0000 (14:47 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 6 Apr 2017 13:15:11 +0000 (15:15 +0200)
This allows static analysers to properly warn on unchecked return values.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
src/certtool.c
src/danetool.c
src/p11tool.c
src/psk.c
src/serv.c
src/srptool.c
src/systemkey.c
src/tests.c

index c0103f19d80f5d137ef79b8a58b36f0831a55eec..bf564529ded9899e010d3f10f7c9e987b89156ed 100644 (file)
@@ -106,7 +106,7 @@ void app_exit(int val)
 {
        if (val != 0) {
                if (outfile_name)
-                       remove(outfile_name);
+                       (void)remove(outfile_name);
        }
        exit(val);
 }
index 6ae8ff50b8fec7eaf4a24934124307978e6dd650..3b4fe6046b2e2b46ee02af0dfd2d9348302703f4 100644 (file)
@@ -75,7 +75,7 @@ void app_exit(int val)
 {
        if (val != 0) {
                if (outfile_name)
-                       remove(outfile_name);
+                       (void)remove(outfile_name);
        }
        exit(val);
 }
@@ -444,7 +444,7 @@ static void dane_check(const char *host, const char *proto,
 
  error:
        if (del != 0 && cinfo->cert) {
-               remove(cinfo->cert);
+               (void)remove(cinfo->cert);
        }
 
        app_exit(retcode);
index e3b24b83536d8dba99486cbc171db9771b795f08..7bb7164cba1459155e010254fdf27c270b1aa1a6 100644 (file)
@@ -59,7 +59,7 @@ void app_exit(int val)
 {
        if (val != 0) {
                if (outfile_name)
-                       remove(outfile_name);
+                       (void)remove(outfile_name);
        }
        exit(val);
 }
index 117fca1d9df34e3fc047fe78c4d07c7ae11a3963..e55803d7c8203806c3ccc9431e3d00c61a53e75b 100644 (file)
--- a/src/psk.c
+++ b/src/psk.c
@@ -213,14 +213,14 @@ write_key(const char *username, const char *key, int key_size,
        if (fd == NULL) {
                fprintf(stderr, "Cannot open '%s' for write\n",
                        passwd_file);
-               remove(tmpname);
+               (void)remove(tmpname);
                return -1;
        }
 
        fd2 = fopen(tmpname, "r");
        if (fd2 == NULL) {
                fprintf(stderr, "Cannot open '%s' for read\n", tmpname);
-               remove(tmpname);
+               (void)remove(tmpname);
                fclose(fd);
                return -1;
        }
@@ -253,7 +253,7 @@ write_key(const char *username, const char *key, int key_size,
        fclose(fd);
        fclose(fd2);
 
-       remove(tmpname);
+       (void)remove(tmpname);
 
 
        return 0;
index 04c5ac912ffedbb9f6131ec7a45e4477f532263d..7f9e403fa595c6f5d8fe5fec871e9551ec62b1f2 100644 (file)
@@ -821,7 +821,7 @@ int listen_socket(const char *name, int listen_port, int socktype)
                        yes = 1;
                        /* avoid listen on ipv6 addresses failing
                         * because already listening on ipv4 addresses: */
-                       setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
+                       (void)setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
                                   (const void *) &yes, sizeof(yes));
                }
 #endif
index 8260f15fd98e00a25a0604f234beb77179347d9e..e2311179c0d648b0beb25100a1962dd8d23fd4c9 100644 (file)
@@ -574,7 +574,7 @@ crypt_int(const char *username, const char *passwd, int salt_size,
                if (fd == NULL) {
                        fprintf(stderr, "Cannot open '%s' for write\n",
                                tpasswd);
-                       remove(tmpname);
+                       (void)remove(tmpname);
                        return -1;
                }
 
@@ -582,7 +582,7 @@ crypt_int(const char *username, const char *passwd, int salt_size,
                if (fd2 == NULL) {
                        fprintf(stderr, "Cannot open '%s' for read\n",
                                tmpname);
-                       remove(tmpname);
+                       (void)remove(tmpname);
                        return -1;
                }
 
@@ -615,7 +615,7 @@ crypt_int(const char *username, const char *passwd, int salt_size,
                fclose(fd);
                fclose(fd2);
 
-               remove(tmpname);
+               (void)remove(tmpname);
 
        }
 
index ce152a3aed986f44d42fdd275ff2ca683393278b..c596d69e0df34b4974ea7d44a24e23830036e056 100644 (file)
@@ -63,7 +63,7 @@ void app_exit(int val)
 {
        if (val != 0) {
                if (outfile_name)
-                       remove(outfile_name);
+                       (void)remove(outfile_name);
        }
        exit(val);
 }
index 2d40b8c6bee58f150d66c3254c05f6afb28ab70f..be5150d2c60783f87c457ee6790f6f4b21da48b3 100644 (file)
@@ -433,7 +433,7 @@ test_code_t test_dhe_group(gnutls_session_t session)
        const char *print;
        FILE *fp;
 
-       remove("debug-dh.out");
+       (void)remove("debug-dh.out");
 
        if (verbose == 0 || pubkey.data == NULL)
                return TEST_IGNORE;
@@ -1304,7 +1304,7 @@ test_code_t test_certificate(gnutls_session_t session)
        int ret;
        FILE *fp;
 
-       remove("debug-certs.out");
+       (void)remove("debug-certs.out");
 
        if (verbose == 0)
                return TEST_IGNORE;
@@ -1455,7 +1455,7 @@ test_code_t test_server_cas(gnutls_session_t session)
 {
        int ret;
 
-       remove("debug-cas.out");
+       (void)remove("debug-cas.out");
        if (verbose == 0)
                return TEST_IGNORE;