summaryrefslogtreecommitdiffstats
path: root/sys-utils/fsfreeze.c
diff options
context:
space:
mode:
authorKarel Zak2013-03-13 13:07:32 +0100
committerKarel Zak2013-03-13 13:07:32 +0100
commitd4543f843d1fa97bd8717f33ea60c81ab1fe1176 (patch)
tree2cdf041cdb0422c45fa0c12413ff0550605ee684 /sys-utils/fsfreeze.c
parentinclude/optutils: make collisions detection between options more robust (diff)
downloadkernel-qcow2-util-linux-d4543f843d1fa97bd8717f33ea60c81ab1fe1176.tar.gz
kernel-qcow2-util-linux-d4543f843d1fa97bd8717f33ea60c81ab1fe1176.tar.xz
kernel-qcow2-util-linux-d4543f843d1fa97bd8717f33ea60c81ab1fe1176.zip
fsfreeze: check for collision between options
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/fsfreeze.c')
-rw-r--r--sys-utils/fsfreeze.c12
1 files changed, 11 insertions, 1 deletions
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 <sys/stat.h>
#include <getopt.h>
+#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);