From: Karel Zak Date: Wed, 13 Mar 2013 12:07:32 +0000 (+0100) Subject: fsfreeze: check for collision between options X-Git-Tag: v2.23-rc1~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4543f843d1fa97bd8717f33ea60c81ab1fe1176;p=thirdparty%2Futil-linux.git fsfreeze: check for collision between options Signed-off-by: Karel Zak --- diff --git a/sys-utils/fsfreeze.c b/sys-utils/fsfreeze.c index a538ef0ba8..122d95cbf2 100644 --- a/sys-utils/fsfreeze.c +++ b/sys-utils/fsfreeze.c @@ -21,10 +21,11 @@ #include #include +#include "c.h" #include "blkdev.h" #include "nls.h" #include "closestream.h" -#include "c.h" +#include "optutils.h" static int freeze_f(int fd) { @@ -67,12 +68,21 @@ int main(int argc, char **argv) { NULL, 0, 0, 0 } }; + static const ul_excl_t excl[] = { /* rows and cols in in ASCII order */ + { 'f','u' }, /* freeze, unfreeze */ + { 0 } + }; + int excl_st[ARRAY_SIZE(excl)] = UL_EXCL_STATUS_INIT; + setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); atexit(close_stdout); while ((c = getopt_long(argc, argv, "hfuV", longopts, NULL)) != -1) { + + err_exclusive_options(c, longopts, excl, excl_st); + switch(c) { case 'h': usage(stdout);