util: use glib string allocation/formatting functions

Convert the string duplication APIs to use the g_strdup family of APIs.

We previously used the 'strdup-posix' gnulib module because mingw does
not set errno to ENOMEM on failure

We previously used the 'strndup' gnulib module because this function
does not exist on mingw.

We previously used the 'vasprintf' gnulib module because of many GNU
supported format specifiers not working on non-Linux platforms. glib's
own equivalent standardizes on GNU format specifiers too.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2019-09-06 13:10:24 +01:00
parent e85e34f3af
commit bb9a1a14e2
4 changed files with 38 additions and 9 deletions

View File

@@ -80,8 +80,6 @@ snprintf
socket
stat-time
strchrnul
strdup-posix
strndup
strerror
strerror_r-posix
strptime
@@ -96,7 +94,6 @@ ttyname_r
uname
unsetenv
usleep
vasprintf
verify
vsnprintf
waitpid