glib-aux: use nm_uuid_parse() helper

This commit is contained in:
Thomas Haller 2021-05-02 13:45:53 +02:00
parent e7568e29b2
commit 42d67415b4
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
4 changed files with 3 additions and 15 deletions

View file

@ -2854,7 +2854,7 @@ again:
NULL,
NULL,
NULL);
if (!contents || !_nm_utils_uuid_parse(nm_strstrip(contents), &uuid)) {
if (!contents || !nm_uuid_parse(nm_strstrip(contents), &uuid)) {
/* generate a random UUID instead. */
is_fake = TRUE;
_nm_utils_uuid_generate_random(&uuid);

View file

@ -3044,17 +3044,6 @@ _nm_utils_sriov_vf_from_strparts(const char *index,
/*****************************************************************************/
NMUuid *
_nm_utils_uuid_parse(const char *str, NMUuid *out_uuid)
{
nm_assert(str);
nm_assert(out_uuid);
if (uuid_parse(str, out_uuid->uuid) != 0)
return NULL;
return out_uuid;
}
NMUuid *
_nm_utils_uuid_generate_random(NMUuid *out_uuid)
{
@ -3148,7 +3137,7 @@ nm_utils_uuid_generate_from_string_bin(NMUuid * uuid,
if (type_args) {
/* type_args can be a name space UUID. Interpret it as (char *) */
if (!_nm_utils_uuid_parse(type_args, &ns_uuid))
if (!nm_uuid_parse(type_args, &ns_uuid))
g_return_val_if_reached(NULL);
}

View file

@ -7219,7 +7219,7 @@ _uuid(const char *str)
static NMUuid u;
g_assert(str);
g_assert(_nm_utils_uuid_parse(str, &u));
g_assert(nm_uuid_parse(str, &u));
return &u;
}

View file

@ -352,7 +352,6 @@ gboolean _nm_utils_check_module_file(const char * name,
/*****************************************************************************/
NMUuid *_nm_utils_uuid_parse(const char *str, NMUuid *uuid);
NMUuid *_nm_utils_uuid_generate_random(NMUuid *out_uuid);
gboolean nm_utils_uuid_is_null(const NMUuid *uuid);