Fix: Remove dead code in fd passing function
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 28 Aug 2018 15:25:01 +0000 (11:25 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 29 Aug 2018 20:36:06 +0000 (16:36 -0400)
Found by Coverity:
CID 1395190 (#1 of 1): Logically dead code (DEADCODE)
dead_error_begin: Execution cannot reach this statement: fprintf(stderr,
"Error: Inv...

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/unix.c

index a87ce05ed581cc6cb1d14788956a6ca0d64cdb38..edca02abf4fa246ad3d33b399ddbd0be252060b8 100644 (file)
@@ -490,11 +490,6 @@ ssize_t lttcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd)
         * message.
         */
        for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
-               if (!cmsg) {
-                       fprintf(stderr, "Error: Invalid control message header\n");
-                       ret = -1;
-                       goto end;
-               }
                if (cmsg->cmsg_level != SOL_SOCKET) {
                        fprintf(stderr, "Error: The socket needs to be of type SOL_SOCKET\n");
                        ret = -1;
This page took 0.026536 seconds and 5 git commands to generate.