block/curl: check error return of curl_global_init()
authorJeff Cody <jcody@redhat.com>
Tue, 7 Nov 2017 22:27:22 +0000 (17:27 -0500)
committerJeff Cody <jcody@redhat.com>
Mon, 18 Dec 2017 20:42:07 +0000 (15:42 -0500)
commit2d25964d1831c99d54981e8b615eba5dd6a63e36
tree3d9923135efc03c32075b55362d773e44fe900a4
parentd507c5f682d23a60a356a081557ceb34ea0d2669
block/curl: check error return of curl_global_init()

If curl_global_init() fails, per the documentation no other curl
functions may be called, so make sure to check the return value.

Also, some minor changes to the initialization latch variable 'inited':

- Make it static in the file, for clarity
- Change the name for clarity
- Make it a bool

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
block/curl.c