]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
Simplify return statement in ipset_mnl_query()
authorStefano Brivio <sbrivio@redhat.com>
Wed, 22 Aug 2018 09:22:54 +0000 (11:22 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 24 Aug 2018 19:02:45 +0000 (21:02 +0200)
As we loop as long as 'ret' is greater than zero, and break only
if we get an error in mnl_cb_run2 (with ret <= 0), we can just
return ret without checking once more if it's greater than zero.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
lib/mnl.c

index a0fa66ecdb805c125db8d9f5675b8b50126a8fc7..4e075cf94f00537feae850238f9577824f26a074 100644 (file)
--- a/lib/mnl.c
+++ b/lib/mnl.c
@@ -115,7 +115,7 @@ ipset_mnl_query(struct ipset_handle *handle, void *buffer, size_t len)
                ret = mnl_socket_recvfrom(handle->h, buffer, len);
                D("message received, ret: %d", ret);
        }
-       return ret > 0 ? 0 : ret;
+       return ret;
 }
 
 static struct ipset_handle *