- if (!(wp = strdup(what_proc_swaps))) {
- r = -ENOMEM;
- goto fail;
- }
-
- if (!m->swaps_by_proc_swaps)
- if (!(m->swaps_by_proc_swaps = hashmap_new(string_hash_func, string_compare_func))) {
- r = -ENOMEM;
- goto fail;
- }
-
- free(p->what);
- p->what = wp;
-
- first = hashmap_get(m->swaps_by_proc_swaps, wp);
- LIST_PREPEND(Swap, same_proc_swaps, first, SWAP(u));
-
- if ((r = hashmap_replace(m->swaps_by_proc_swaps, wp, first)) < 0)
- goto fail;
- }
-
- if (set_flags) {
- SWAP(u)->is_active = true;
- SWAP(u)->just_activated = !SWAP(u)->from_proc_swaps;
- }
-
- SWAP(u)->from_proc_swaps = true;
-
- } else {
- p = &SWAP(u)->parameters_etc_fstab;
-
- if (!(wp = strdup(what))) {