libxl: Clean up userlookup_helper_getpw* helper
authorGeorge Dunlap <george.dunlap@citrix.com>
Fri, 21 Dec 2018 15:41:06 +0000 (15:41 +0000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 21 Dec 2018 18:41:51 +0000 (18:41 +0000)
commit6572b665782ff881bfdede09e07710824bb7a7be
tree433c0cfb431564fe9b0afc2099ec4dc499eeba39
parent28b5856b02ca717951ee4a5eb9bc047b1fc9189c
libxl: Clean up userlookup_helper_getpw* helper

Bring conventions more in line with libxl__xs_read_checked():
- If found, return 0 and set pointer to non-NULL
- If not found, return 0 and set pointer to NULL
- On error, return libxl-style error number.

Update documentation to match.

Use CODING_STYLE compliant `r` rather than `ret`.

On error, log the error code before returning instead of discarding
it.

Now that it only returns 0 or errno, update caller error checks to be
`if (ret)` rather than `if (ret < 0)`.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_dm.c