mirror of
https://github.com/systemd/systemd.git
synced 2026-06-30 19:57:29 +00:00
shared: Add a image_policy_copy() helper method
This will be used in an upcoming commit to move global command line argument variables in sysupdate into its `Context` struct.
This commit is contained in:
@@ -948,6 +948,12 @@ ImagePolicy* image_policy_free(ImagePolicy *p) {
|
||||
return mfree(p);
|
||||
}
|
||||
|
||||
ImagePolicy* image_policy_copy(const ImagePolicy *p) {
|
||||
assert(p);
|
||||
|
||||
return memdup(p, offsetof(ImagePolicy, policies) + sizeof(PartitionPolicy) * p->n_policies);
|
||||
}
|
||||
|
||||
int image_policy_ignore_designators(const ImagePolicy *p, const PartitionDesignator table[], size_t n_table, ImagePolicy **ret) {
|
||||
assert(p);
|
||||
assert(table || n_table == 0);
|
||||
|
||||
@@ -119,6 +119,8 @@ ImagePolicy* image_policy_free(ImagePolicy *p);
|
||||
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(ImagePolicy*, image_policy_free);
|
||||
|
||||
ImagePolicy* image_policy_copy(const ImagePolicy *p);
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_image_policy);
|
||||
int parse_image_policy_argument(const char *s, ImagePolicy **policy);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user