From 969ddc00c47cc261154760bdc960cc7e14a89a44 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Wed, 5 Dec 2018 17:57:43 +0100 Subject: [PATCH] F #1684: Fix warnings --- .../lib/lxd/svncterm_server/svncterm_server.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/vmm_mad/remotes/lib/lxd/svncterm_server/svncterm_server.c b/src/vmm_mad/remotes/lib/lxd/svncterm_server/svncterm_server.c index 4d8d540734..36a54ccbf7 100644 --- a/src/vmm_mad/remotes/lib/lxd/svncterm_server/svncterm_server.c +++ b/src/vmm_mad/remotes/lib/lxd/svncterm_server/svncterm_server.c @@ -1917,7 +1917,7 @@ int init_ctrl_pipe() return -1; } } - else if ( buffer.st_mode & S_IFMT != S_IFIFO ) + else if ( (buffer.st_mode & S_IFMT) != S_IFIFO ) { fprintf(stderr,"File %s is not valid, please remove it\n", CTRL_PIPE_PATH); return -1; @@ -1965,7 +1965,7 @@ int add_cmd(struct vncterm_command * cmd, struct vncterm_command ** client_fds) char serv[NI_MAXSERV]; - int yes = 1; + int yes = 1; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; @@ -1991,11 +1991,11 @@ int add_cmd(struct vncterm_command * cmd, struct vncterm_command ** client_fds) return -1; } - if (setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof(int)) < 0) - { + if (setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof(int)) < 0) + { freeaddrinfo(results); - close(sd); - return -1; + close(sd); + return -1; } @@ -2015,6 +2015,8 @@ int add_cmd(struct vncterm_command * cmd, struct vncterm_command ** client_fds) } client_fds[sd] = cmd; + + return 0; } void cmd_ctrl_pipe(int pipe_fd, struct vncterm_command ** client_fds)