]> granicus.if.org Git - ipset/commitdiff
Fix errors when compiling in debug mode.
authorKrunal Patel <krunal.patel@elitecore.com>
Fri, 31 Aug 2012 15:06:09 +0000 (17:06 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 31 Aug 2012 15:06:09 +0000 (17:06 +0200)
include/libipset/ui.h
src/ipset.c
src/ui.c

index 78d5866f6f9ded06c087e429ce4dfee5264dbdb4..2b7119e13712e950e00045ff87f4f2ce61c581fc 100644 (file)
@@ -43,5 +43,6 @@ extern bool ipset_match_option(const char *arg, const char * const name[]);
 extern bool ipset_match_envopt(const char *arg, const char * const name[]);
 extern void ipset_shift_argv(int *argc, char *argv[], int from);
 extern void ipset_port_usage(void);
+extern int ipset_parse_file(struct ipset_session *s, int opt, const char *str);
 
 #endif /* LIBIPSET_UI_H */
index e649f08486ac057a07b149bb9b9d298c86d44d13..2709d7b787f11767aacb78b30610802835cc1a00 100644 (file)
@@ -129,7 +129,7 @@ help(void)
 }
 
 int
-ipset_parse_file(struct ipset_session *session UNUSED,
+ipset_parse_file(struct ipset_session *s UNUSED,
                 int opt UNUSED, const char *str)
 {
        if (filename != NULL)
@@ -140,6 +140,7 @@ ipset_parse_file(struct ipset_session *session UNUSED,
        return 0;
 }
 
+static 
 int __attribute__ ((format (printf, 1, 2)))
 ipset_print_file(const char *fmt, ...)
 {
@@ -190,7 +191,7 @@ restore(char *argv0)
 {
        int ret = 0;
        char *c;
-       FILE *fread = stdin;
+       FILE *rfd = stdin;
 
        /* Initialize newargv/newargc */
        newargc = 0;
@@ -202,10 +203,10 @@ restore(char *argv0)
                                          "Cannot open %s for reading: %s",
                                          filename, strerror(errno));
                }
-               fread = fd;
+               rfd = fd;
        }
 
-       while (fgets(cmdline, sizeof(cmdline), fread)) {
+       while (fgets(cmdline, sizeof(cmdline), rfd)) {
                restore_line++;
                c = cmdline;
                while (isspace(c[0]))
index bdd060251d73796ea735204a420c3d4f60ab62ca..ef722c73c90c3c3f7d0add3801322f6b7b34f002 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -179,10 +179,6 @@ ipset_match_cmd(const char *arg, const char * const name[])
  *     -!              -exist
  */
 
-int
-ipset_parse_file(struct ipset_session *session,
-                 int opt, const char *str);
-
 const struct ipset_envopts ipset_envopts[] = {
        { .name = { "-o", "-output" },
          .has_arg = IPSET_MANDATORY_ARG,       .flag = IPSET_OPT_MAX,