Currently, the 'swapoff' is the default behavior. It means that if you
have a libtool wrapper script in your build directory the executed binary
name is 'lt-swapon' and then "swapon -a" is interpreted as "swapoff -a".
Any random argv[0] should not be interpreted as "swapoff".
Signed-off-by: Karel Zak <kzak@redhat.com>
if (streq(progname, "swapon"))
return main_swapon(argc, argv);
- else
+ else if (streq(progname, "swapoff"))
return main_swapoff(argc, argv);
+
+ errx(EXIT_FAILURE, _("'%s' is unsupported program name "
+ "(must be 'swapon' or 'swapoff')."), progname);
}