nandwrite: fix build when long options are disabled
authorBaruch Siach <baruch at tkos.co.il>
Wed, 17 Dec 2014 16:02:37 +0000 (17:02 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 17 Dec 2014 16:02:37 +0000 (17:02 +0100)
The Required_argument macro is only defined when long options are enabled.
Fixes the following build error:

miscutils/nandwrite.c: In function 'nandwrite_main':
miscutils/nandwrite.c:120:10: error: expected ',' or ';' before 'Required_argument'

Reported-by: Christian Kästner <kaestner at cs.cmu.edu>
Signed-off-by: Baruch Siach <baruch at tkos.co.il>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/nandwrite.c

index 29ff351a3e7d11354f2ffed8e103f940419f7aef..c825fc31519d1d6a76235a073ec69b46365bd0db 100644 (file)
@@ -116,12 +116,13 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv)
        struct mtd_oob_buf oob;
        unsigned char *filebuf;
        const char *opt_s = "0", *opt_f = "-", *opt_l, *opt_bb;
-       static const char nanddump_longopts[] ALIGN1 =
-               "bb\0" Required_argument "\xff"; /* no short equivalent */
 
        if (IS_NANDDUMP) {
                opt_complementary = "=1";
-               applet_long_options = nanddump_longopts;
+#if ENABLE_LONG_OPTS
+               applet_long_options =
+                       "bb\0" Required_argument "\xff"; /* no short equivalent */
+#endif
                opts = getopt32(argv, "os:f:l:", &opt_s, &opt_f, &opt_l, &opt_bb);
        } else { /* nandwrite */
                opt_complementary = "-1:?2";