[PATCH 4/8] totemip: Check setsockopt return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/totemip.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/exec/totemip.c b/exec/totemip.c
index cc10344..ab175a8 100644
--- a/exec/totemip.c
+++ b/exec/totemip.c
@@ -540,7 +540,10 @@ int totemip_iface_check(struct totem_ip_address *bindnet,
 	if (fd <0)
 		return -1;
 
-        setsockopt(fd,SOL_SOCKET,SO_RCVBUF,&rcvbuf,sizeof(rcvbuf));
+        if (setsockopt(fd,SOL_SOCKET,SO_RCVBUF,&rcvbuf,sizeof(rcvbuf)) == -1) {
+		close(fd);
+		return -1;
+	}
 
         memset(&nladdr, 0, sizeof(nladdr));
         nladdr.nl_family = AF_NETLINK;
-- 
1.7.1

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss




[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux