mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-20 10:10:27 +01:00
settings/keyfile: output "struct stat" from nms_keyfile_loaded_uuid_read()
We already stat() the file, so optionally return the stat result to the caller.
This commit is contained in:
parent
779555bc64
commit
050f61519c
3 changed files with 8 additions and 5 deletions
|
|
@ -64,7 +64,8 @@ nms_keyfile_loaded_uuid_read (const char *dirname,
|
|||
const char *filename,
|
||||
char **out_full_filename,
|
||||
char **out_uuid,
|
||||
char **out_loaded_path)
|
||||
char **out_loaded_path,
|
||||
struct stat *out_st)
|
||||
{
|
||||
const char *uuid;
|
||||
const char *tmp;
|
||||
|
|
@ -115,7 +116,7 @@ nms_keyfile_loaded_uuid_read (const char *dirname,
|
|||
|
||||
if (!nms_keyfile_utils_check_file_permissions (NMS_KEYFILE_FILETYPE_NMLOADED,
|
||||
full_filename,
|
||||
NULL,
|
||||
out_st,
|
||||
NULL))
|
||||
return FALSE;
|
||||
|
||||
|
|
@ -148,7 +149,8 @@ nms_keyfile_loaded_uuid_read_from_file (const char *full_filename,
|
|||
filename,
|
||||
NULL,
|
||||
out_uuid,
|
||||
out_loaded_path))
|
||||
out_loaded_path,
|
||||
NULL))
|
||||
return FALSE;
|
||||
|
||||
NM_SET_OUT (out_dirname, g_steal_pointer (&dirname));
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ gboolean nms_keyfile_loaded_uuid_read (const char *dirname,
|
|||
const char *filename,
|
||||
char **out_full_filename,
|
||||
char **out_uuid,
|
||||
char **out_loaded_path);
|
||||
char **out_loaded_path,
|
||||
struct stat *out_st);
|
||||
|
||||
gboolean nms_keyfile_loaded_uuid_read_from_file (const char *full_filename,
|
||||
char **out_dirname,
|
||||
|
|
|
|||
|
|
@ -2550,7 +2550,7 @@ _assert_keyfile_loaded_uuid (const char *dirname,
|
|||
g_assert_cmpstr (symlink_target, ==, exp_symlink_target);
|
||||
|
||||
|
||||
success = nms_keyfile_loaded_uuid_read (dirname, filename, &full_filename, &uuid2, &loaded_path2);
|
||||
success = nms_keyfile_loaded_uuid_read (dirname, filename, &full_filename, &uuid2, &loaded_path2, NULL);
|
||||
g_assert_cmpint (!!exp_uuid, ==, success);
|
||||
if (success)
|
||||
g_assert_cmpstr (full_filename, ==, exp_full_filename);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue