]> arthur.barton.de Git - bup.git/commit
grp_struct_to_py(): fix error handling
authorJohannes Berg <johannes@sipsolutions.net>
Fri, 19 Jun 2020 05:19:07 +0000 (07:19 +0200)
committerRob Browning <rlb@defaultvalue.org>
Sun, 5 Jul 2020 16:16:23 +0000 (11:16 -0500)
commitd632a13fb8c9e5f47151c70da07bfd78e7c09f28
tree36cbd21bca2acc780ede630d4458a0997e4d3328
parent79761d33168ffdc70d2770fe16948387eab5967c
grp_struct_to_py(): fix error handling

Both getgrgid_r() and getgrnam_r() *return* an error number
on failures, and don't store it to errno. Thus, rc will not
be less than zero, and we need to set errno before we can
create a python error from it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/_helpers.c