]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables-standalone: Drop version number from init errors
authorPhil Sutter <phil@nwl.cc>
Mon, 27 Sep 2021 14:59:49 +0000 (16:59 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 20 Oct 2021 09:32:54 +0000 (11:32 +0200)
Aside from the rather unconventional formatting, if those initialization
functions fail we've either released a completely broken iptables or
the wrong libraries are chosen by the loader. In both cases, the version
number is not really interesting.

While being at it, fix indenting of the first exit() call.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/xtables-standalone.c

index f4d40cda6ae43679e4cc31321e287fb1bbaa9550..54c70c5429766ad81f1388d6e39c338e0214598b 100644 (file)
@@ -49,10 +49,8 @@ xtables_main(int family, const char *progname, int argc, char *argv[])
        xtables_globals.program_name = progname;
        ret = xtables_init_all(&xtables_globals, family);
        if (ret < 0) {
-               fprintf(stderr, "%s/%s Failed to initialize xtables\n",
-                               xtables_globals.program_name,
-                               xtables_globals.program_version);
-                               exit(1);
+               fprintf(stderr, "%s: Failed to initialize xtables\n", progname);
+               exit(1);
        }
 #if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS)
        init_extensions();
@@ -61,10 +59,8 @@ xtables_main(int family, const char *progname, int argc, char *argv[])
 #endif
 
        if (nft_init(&h, family) < 0) {
-               fprintf(stderr, "%s/%s Failed to initialize nft: %s\n",
-                               xtables_globals.program_name,
-                               xtables_globals.program_version,
-                               strerror(errno));
+               fprintf(stderr, "%s: Failed to initialize nft: %s\n",
+                       xtables_globals.program_name, strerror(errno));
                exit(EXIT_FAILURE);
        }