From: Matthew Dillon Date: Wed, 12 Aug 2009 23:27:45 +0000 (-0700) Subject: devtab - swapon now supports /etc/devtab X-Git-Tag: v2.4.0~268 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/c4d5a9b31c7f5abeb263995b18e28f73d23a8ab9?ds=sidebyside devtab - swapon now supports /etc/devtab --- diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index ff807ec622..a3e2cacf6f 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -67,7 +67,7 @@ main(int argc, char **argv) argv += optind; stat = 0; - if (doall) + if (doall) { while ((fsp = getfsent()) != NULL) { if (strcmp(fsp->fs_type, FSTAB_SW)) continue; @@ -79,10 +79,13 @@ main(int argc, char **argv) printf("swapon: adding %s as swap device\n", fsp->fs_spec); } - else if (!*argv) + } else if (*argv == NULL) { usage(); - for (; *argv; ++argv) - stat |= add(*argv, 0); + } + while (*argv) { + stat |= add(getdevpath(*argv, 0), 0); + ++argv; + } exit(stat); }