diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2014-06-17 12:58:10 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-06-17 15:33:26 (GMT) |
commit | b6cadfefabe1a029ed4188b67663820d27ba044e (patch) | |
tree | 5a62450b8fd34fbef5d106a83bac22204310defa | |
parent | 8f82270cffb7034bc930a9606bc8e1412d2fa73d (diff) | |
download | libnl-b6cadfefabe1a029ed4188b67663820d27ba044e.zip libnl-b6cadfefabe1a029ed4188b67663820d27ba044e.tar.gz libnl-b6cadfefabe1a029ed4188b67663820d27ba044e.tar.bz2 |
cache_mngr: Fix assignment of error code in nl_cache_mngr_alloc()
In the current form, the parentheses in these two if (...) statements
lead to err being assigned the result of nl_connect(...) < 0 and
nl_socket_set_nonblocking(...) < 0 instead of the return value of these
functions. Adjust the parentheses to assign the returned error code to
err.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r-- | lib/cache_mngr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/cache_mngr.c b/lib/cache_mngr.c index e24d44c..9b25e9b 100644 --- a/lib/cache_mngr.c +++ b/lib/cache_mngr.c @@ -165,10 +165,10 @@ int nl_cache_mngr_alloc(struct nl_sock *sk, int protocol, int flags, /* Required to receive async event notifications */ nl_socket_disable_seq_check(mngr->cm_sock); - if ((err = nl_connect(mngr->cm_sock, protocol) < 0)) + if ((err = nl_connect(mngr->cm_sock, protocol)) < 0) goto errout; - if ((err = nl_socket_set_nonblocking(mngr->cm_sock) < 0)) + if ((err = nl_socket_set_nonblocking(mngr->cm_sock)) < 0) goto errout; /* Create and allocate socket for sync cache fills */ |