mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
util: replace strerror/strerror_r with g_strerror
g_strerror is offers the safety/correctness benefits of strerror_r, with the API design convenience of strerror. Use of virStrerror should be eliminated through the codebase in favour of g_strerror. commandhelper.c is a special case as its a tiny single threaded test program, not linked to glib, so it just uses traditional strerror(). Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
@@ -1051,6 +1051,10 @@ BAD:
|
||||
<dd>The GLib macros g_autoptr and G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
||||
should be used to manage autoclean of virObject classes.
|
||||
This matches usage with GObject classes.</dd>
|
||||
|
||||
<dt>virStrerror</dt>
|
||||
<dd>The GLib g_strerror() function should be used instead,
|
||||
which has a simpler calling convention as an added benefit.</dd>
|
||||
</dl>
|
||||
|
||||
<h2><a id="file_handling">File handling</a></h2>
|
||||
|
||||
Reference in New Issue
Block a user