summaryrefslogtreecommitdiff
path: root/sutils
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-03-24 11:33:36 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-03-24 11:33:36 +0100
commit0715d1b22a6f0008b70fe4b1881045f65521ac19 (patch)
tree3e065978df1c6b53ae797a925b88f994cbbbdd45 /sutils
parentb235bd2724ad4cf9150b0f571ead70fbfa34da84 (diff)
Use swapon path as pager partition path
When /dev/hd* entries are parted-partition storeio, the store name is only the disk name, thus not unique. We should just use the path being used instead. * sutils/swapon.c (swaponoff): Use `file' instead of `store->name' to default_pager_paging_file. (main): Drop hardcoded "/dev/". * procfs/rootdir.c (rootdir_gc_swaps): Drop hardcoded "/dev/".
Diffstat (limited to 'sutils')
-rw-r--r--sutils/swapon.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sutils/swapon.c b/sutils/swapon.c
index 1d0d4353..40f5a205 100644
--- a/sutils/swapon.c
+++ b/sutils/swapon.c
@@ -424,9 +424,7 @@ swaponoff (const char *file, int add, int skipnotexisting)
{
/* The default pager does not support the new protocol.
We tried it in a previous call (below) and got MIG_BAD_ID. */
- char pname[sizeof "/dev/" + strlen (store->name) + 1];
- strcpy (stpcpy (pname, "/dev/"), store->name);
- err = default_pager_paging_file (def_pager, dev_master, pname, add);
+ err = default_pager_paging_file (def_pager, dev_master, file, add);
}
else
{
@@ -439,7 +437,7 @@ swaponoff (const char *file, int add, int skipnotexisting)
runs[j++] = store->runs[i].length;
}
err = default_pager_paging_storage (def_pager, store->port,
- runs, j, store->name, add);
+ runs, j, file, add);
if (err == MIG_BAD_ID)
{
/* The default pager does not support the new protocol.
@@ -580,7 +578,7 @@ main (int argc, char *argv[])
name = names;
for (i = 0; i < nfree; i++)
{
- printf ("/dev/%s\tpartition\t%zuM\t%zuM\t-1\n",
+ printf ("%s\tpartition\t%zuM\t%zuM\t-1\n",
name, size[i] >> 20, (size[i] - free[i]) >> 20);
name = argz_next (names, names_len, name);
}