[njs] Fixing Coverity warnings related to close() (CID 1444170).

Dmitry Volyntsev xeioex at nginx.com
Tue Oct 8 12:57:13 UTC 2019


details:   https://hg.nginx.org/njs/rev/9f1ba171d81e
branches:  
changeset: 1176:9f1ba171d81e
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Oct 08 15:56:58 2019 +0300
description:
Fixing Coverity warnings related to close() (CID 1444170).

diffstat:

 src/njs_module.c |  2 +-
 src/njs_shell.c  |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r b63351157159 -r 9f1ba171d81e src/njs_module.c
--- a/src/njs_module.c	Mon Sep 30 11:41:00 2019 +0300
+++ b/src/njs_module.c	Tue Oct 08 15:56:58 2019 +0300
@@ -139,7 +139,7 @@ njs_parser_module(njs_vm_t *vm, njs_pars
 
     ret = njs_module_read(vm, info.fd, &text);
 
-    close(info.fd);
+    (void) close(info.fd);
 
     if (njs_slow_path(ret != NJS_OK)) {
         njs_internal_error(vm, "while reading \"%V\" module", &name);
diff -r b63351157159 -r 9f1ba171d81e src/njs_shell.c
--- a/src/njs_shell.c	Mon Sep 30 11:41:00 2019 +0300
+++ b/src/njs_shell.c	Tue Oct 08 15:56:58 2019 +0300
@@ -633,7 +633,7 @@ done:
 close_fd:
 
     if (fd != STDIN_FILENO) {
-        close(fd);
+        (void) close(fd);
     }
 
     return ret;


More information about the nginx-devel mailing list