diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-05-15 05:40:34 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-08-05 01:32:28 +0900 |
commit | 6688b72d32f450d243a47ab960dc131ebe666e67 (patch) | |
tree | 5e1d901aa780b70d057b0695a7ec65afd084601b /src/core/mount.c | |
parent | f17061ef95b48530b3a6fdad0b584a5fec0e1b32 (diff) | |
download | systemd-6688b72d32f450d243a47ab960dc131ebe666e67.tar.gz |
core/mount: use set_put_strdup_full()
Diffstat (limited to 'src/core/mount.c')
-rw-r--r-- | src/core/mount.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/core/mount.c b/src/core/mount.c index d22e7dec59..8aaa9e966b 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1984,7 +1984,7 @@ static int drain_libmount(Manager *m) { } static int mount_process_proc_self_mountinfo(Manager *m) { - _cleanup_set_free_free_ Set *around = NULL, *gone = NULL; + _cleanup_set_free_ Set *around = NULL, *gone = NULL; const char *what; int r; @@ -2015,13 +2015,10 @@ static int mount_process_proc_self_mountinfo(Manager *m) { * existed. */ if (mount->from_proc_self_mountinfo && - mount->parameters_proc_self_mountinfo.what) { - + mount->parameters_proc_self_mountinfo.what) /* Remember that this device might just have disappeared */ - if (set_ensure_allocated(&gone, &path_hash_ops) < 0 || - set_put_strdup(&gone, mount->parameters_proc_self_mountinfo.what) < 0) + if (set_put_strdup_full(&gone, &path_hash_ops_free, mount->parameters_proc_self_mountinfo.what) < 0) log_oom(); /* we don't care too much about OOM here... */ - } mount->from_proc_self_mountinfo = false; assert_se(update_parameters_proc_self_mountinfo(mount, NULL, NULL, NULL) >= 0); @@ -2079,13 +2076,10 @@ static int mount_process_proc_self_mountinfo(Manager *m) { if (mount_is_mounted(mount) && mount->from_proc_self_mountinfo && - mount->parameters_proc_self_mountinfo.what) { + mount->parameters_proc_self_mountinfo.what) /* Track devices currently used */ - - if (set_ensure_allocated(&around, &path_hash_ops) < 0 || - set_put_strdup(&around, mount->parameters_proc_self_mountinfo.what) < 0) + if (set_put_strdup_full(&around, &path_hash_ops_free, mount->parameters_proc_self_mountinfo.what) < 0) log_oom(); - } /* Reset the flags for later calls */ mount->proc_flags = 0; |