]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
remount-fs: use hash ops with destructor
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 22 Jan 2025 01:51:13 +0000 (10:51 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 23 Jan 2025 09:22:53 +0000 (18:22 +0900)
src/remount-fs/remount-fs.c

index 37c7b389b4c35536036c9220e6ee2798b93f18db..21167a7b4ae587c902b212b85c60605bf091eb12 100644 (file)
@@ -34,7 +34,7 @@ static int track_pid(Hashmap **h, const char *path, pid_t pid) {
         if (!c)
                 return log_oom();
 
-        r = hashmap_ensure_put(h, NULL, PID_TO_PTR(pid), c);
+        r = hashmap_ensure_put(h, &trivial_hash_ops_value_free, PID_TO_PTR(pid), c);
         if (r == -ENOMEM)
                 return log_oom();
         if (r < 0)
@@ -70,7 +70,7 @@ static int do_remount(const char *path, bool force_rw, Hashmap **pids) {
 }
 
 static int remount_by_fstab(Hashmap **ret_pids) {
-        _cleanup_hashmap_free_free_ Hashmap *pids = NULL;
+        _cleanup_hashmap_free_ Hashmap *pids = NULL;
         _cleanup_endmntent_ FILE *f = NULL;
         bool has_root = false;
         struct mntent* me;
@@ -108,7 +108,7 @@ static int remount_by_fstab(Hashmap **ret_pids) {
 }
 
 static int run(int argc, char *argv[]) {
-        _cleanup_hashmap_free_free_ Hashmap *pids = NULL;
+        _cleanup_hashmap_free_ Hashmap *pids = NULL;
         int r;
 
         log_setup();