]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Use i_close_fd instead of close
authorAki Tuomi <aki.tuomi@dovecot.fi>
Fri, 6 Oct 2017 05:58:16 +0000 (08:58 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 10 Oct 2017 08:41:04 +0000 (11:41 +0300)
Some were missed, found by coverity

src/lib-program-client/test-program-client-net.c
src/lib/test-iostream-proxy.c
src/master/sd-daemon.c
src/plugins/fts-squat/squat-test.c

index 0a47a902fb28eeb26986cb45564e8c284697c242..3c9d0f285d6ae6ecd9bfc11e11fe259020c43c51 100644 (file)
@@ -90,7 +90,7 @@ void test_program_client_destroy(struct test_client **_client)
        i_stream_unref(&client->in);
        o_stream_unref(&client->os_body);
        i_stream_unref(&client->body);
-       close(client->fd);
+       i_close_fd(&client->fd);
        pool_unref(&client->pool);
        test_globals.client = NULL;
        test_program_io_loop_stop();
index 59d70b5c1661aa0a07014b85ddcf3baabaafba37..c2666b43e3af25f92b17d82eb741028e25abd45a 100644 (file)
@@ -96,10 +96,10 @@ void test_iostream_proxy_simple(void)
        i_stream_unref(&right_in);
 
        /* close fd */
-       close(sfdl[0]);
-       close(sfdl[1]);
-       close(sfdr[0]);
-       close(sfdr[1]);
+       i_close_fd(&sfdl[0]);
+       i_close_fd(&sfdl[1]);
+       i_close_fd(&sfdr[0]);
+       i_close_fd(&sfdr[1]);
 
        test_end();
 }
index 6d1eebff07c68a977abc325a3c9c3592839a24ee..012a8f7f279a794c9b05ecbbf5561168bac559de 100644 (file)
@@ -387,7 +387,7 @@ finish:
                 unsetenv("NOTIFY_SOCKET");
 
         if (fd >= 0)
-                close(fd);
+               (void)close(fd);
 
         return r;
 #endif
index 8d9545754ef694e8663529037c776f182b89ade6..8447e191250b5cb9672ae06c853623008b18d358 100644 (file)
@@ -169,7 +169,7 @@ int main(int argc ATTR_UNUSED, char *argv[])
                (float)input->v_offset * 100.0);
 
        i_stream_unref(&input);
-       close(fd);
+       i_close_fd(&fd);
 
        i_array_init(&definite_uids, 128);
        i_array_init(&maybe_uids, 128);