[PATCH] virthread: Make sure virOnce() returns -1 on error

Ján Tomko jtomko at redhat.com
Fri May 7 09:42:59 UTC 2021

On a Tuesday in 2021, Michal Privoznik wrote:
>Since its introduction in v0.9.1~65 the virOnce() was expected to
>follow the usual retval logic (0 for success, a negative number
>for failure). However, that was never the case.
>On the other hand, looking into glibc and musl the pthread_once()
>never returns anything other than zero (uclibc-ng seems to not
>implement pthread_once()), therefore we never really hit any
>problem. But for code cleanliness (and to match POSIX
>documentation), let's change to code so that our retval logic is
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> src/util/virthread.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)

Reviewed-by: Ján Tomko <jtomko at redhat.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210507/05624ebf/attachment-0001.sig>

More information about the libvir-list mailing list