From d4543f843d1fa97bd8717f33ea60c81ab1fe1176 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 13 Mar 2013 13:07:32 +0100 Subject: fsfreeze: check for collision between options Signed-off-by: Karel Zak --- sys-utils/fsfreeze.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sys-utils/fsfreeze.c') diff --git a/sys-utils/fsfreeze.c b/sys-utils/fsfreeze.c index a538ef0ba..122d95cbf 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); -- cgit v1.2.3-55-g7522