ctdb: Fix CID 1398179 Argument cannot be negative
authorVolker Lendecke <vl@samba.org>
Tue, 27 Dec 2016 10:47:10 +0000 (10:47 +0000)
committerDavid Disseldorp <ddiss@samba.org>
Tue, 27 Dec 2016 13:21:27 +0000 (14:21 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
ctdb/common/sock_daemon.c

index 0a6573c36d5248db1e87d6181fe0cd9d4653909d..dc5dba0b429779634f772018be4e2ee8304c69cc 100644 (file)
@@ -282,7 +282,7 @@ static int sock_socket_init(TALLOC_CTX *mem_ctx, const char *sockpath,
 
 static int sock_socket_destructor(struct sock_socket *sock)
 {
-       if (sock->fd == -1) {
+       if (sock->fd != -1) {
                close(sock->fd);
                sock->fd = -1;
        }