[patch libnl] genl: genl_ctrl_grp_by_name: fix retval in case group id not found
Jiri Pirko
jpirko at redhat.com
Wed Aug 31 05:14:43 EDT 2011
Now the return value in case group id is not find is 0. Change it to
return -NLE_OBJ_NOTFOUND which makes more sense. This should not break
anything because genl_ctrl_grp_by_name is static and called only from
genl_ctrl_resolve_grp. genl_ctrl_resolve_grp already might return
-NLE_OBJ_NOTFOUND.
Signed-off-by: Jiri Pirko <jpirko at redhat.com>
---
lib/genl/ctrl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/genl/ctrl.c b/lib/genl/ctrl.c
index 3871795..107a4fa 100644
--- a/lib/genl/ctrl.c
+++ b/lib/genl/ctrl.c
@@ -293,7 +293,7 @@ static int genl_ctrl_grp_by_name(const struct genl_family *family,
}
}
- return 0;
+ return -NLE_OBJ_NOTFOUND;
}
int genl_ctrl_resolve_grp(struct nl_sock *sk, const char *family_name,
--
1.7.6
More information about the libnl
mailing list