summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--procfs/rootdir.c2
-rw-r--r--sutils/swapon.c8
2 files changed, 4 insertions, 6 deletions
diff --git a/procfs/rootdir.c b/procfs/rootdir.c
index 951c071d..8e7c6595 100644
--- a/procfs/rootdir.c
+++ b/procfs/rootdir.c
@@ -557,7 +557,7 @@ rootdir_gc_swaps (void *hook, char **contents, ssize_t *contents_len)
name = names;
for (i = 0; i < nfree; i++)
{
- fprintf (m, "/dev/%s\tpartition\t%zu\t%zu\t-1\n",
+ fprintf (m, "%s\tpartition\t%zu\t%zu\t-1\n",
name, size[i] >> 10, (size[i] - free[i]) >> 10);
name = argz_next (names, names_len, name);
}
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);
}