From 1829ed482efbc8b390cc760d012b3a4450494e1a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 21 Feb 2009 03:29:44 +0100 Subject: libxtables: prefix exit_error to xtables_error Signed-off-by: Jan Engelhardt --- extensions/libxt_time.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'extensions/libxt_time.c') diff --git a/extensions/libxt_time.c b/extensions/libxt_time.c index 41aa5c77..eb8b671b 100644 --- a/extensions/libxt_time.c +++ b/extensions/libxt_time.c @@ -142,10 +142,10 @@ static time_t time_parse_date(const char *s, bool end) if (ret >= 0) return ret; perror("mktime"); - exit_error(OTHER_PROBLEM, "mktime returned an error"); + xtables_error(OTHER_PROBLEM, "mktime returned an error"); out: - exit_error(PARAMETER_PROBLEM, "Invalid date \"%s\" specified. Should " + xtables_error(PARAMETER_PROBLEM, "Invalid date \"%s\" specified. Should " "be YYYY[-MM[-DD[Thh[:mm[:ss]]]]]", os); return -1; } @@ -175,7 +175,7 @@ static unsigned int time_parse_minutes(const char *s) return 60 * 60 * hour + 60 * minute + second; out: - exit_error(PARAMETER_PROBLEM, "invalid time \"%s\" specified, " + xtables_error(PARAMETER_PROBLEM, "invalid time \"%s\" specified, " "should be hh:mm[:ss] format and within the boundaries", s); return -1; } @@ -207,7 +207,7 @@ static uint32_t time_parse_monthdays(const char *arg) while (my_strseg(day, sizeof(day), &arg, ',') != NULL) { i = strtoul(day, &err, 0); if ((*err != ',' && *err != '\0') || i > 31) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "%s is not a valid day for --monthdays", day); ret |= 1 << i; } @@ -225,7 +225,7 @@ static unsigned int time_parse_weekdays(const char *arg) i = strtoul(day, &err, 0); if (*err == '\0') { if (i == 0) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "No, the week does NOT begin with Sunday."); ret |= 1 << i; continue; @@ -239,7 +239,7 @@ static unsigned int time_parse_weekdays(const char *arg) } if (!valid) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "%s is not a valid day specifier", day); } @@ -254,54 +254,54 @@ static int time_parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case 'D': /* --datestart */ if (*flags & F_DATE_START) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot specify --datestart twice"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected \"!\" with --datestart"); info->date_start = time_parse_date(optarg, false); *flags |= F_DATE_START; return 1; case 'E': /* --datestop */ if (*flags & F_DATE_STOP) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot specify --datestop more than once"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "unexpected \"!\" with --datestop"); info->date_stop = time_parse_date(optarg, true); *flags |= F_DATE_STOP; return 1; case 'X': /* --timestart */ if (*flags & F_TIME_START) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot specify --timestart more than once"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected \"!\" with --timestart"); info->daytime_start = time_parse_minutes(optarg); *flags |= F_TIME_START; return 1; case 'Y': /* --timestop */ if (*flags & F_TIME_STOP) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot specify --timestop more than once"); if (invert) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Unexpected \"!\" with --timestop"); info->daytime_stop = time_parse_minutes(optarg); *flags |= F_TIME_STOP; return 1; case 'l': /* --localtz */ if (*flags & F_TIMEZONE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can only specify exactly one of --localtz or --utc"); info->flags |= XT_TIME_LOCAL_TZ; *flags |= F_TIMEZONE; return 1; case 'm': /* --monthdays */ if (*flags & F_MONTHDAYS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot specify --monthdays more than once"); info->monthdays_match = time_parse_monthdays(optarg); if (invert) @@ -310,7 +310,7 @@ static int time_parse(int c, char **argv, int invert, unsigned int *flags, return 1; case 'w': /* --weekdays */ if (*flags & F_WEEKDAYS) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Cannot specify --weekdays more than once"); info->weekdays_match = time_parse_weekdays(optarg); if (invert) @@ -319,7 +319,7 @@ static int time_parse(int c, char **argv, int invert, unsigned int *flags, return 1; case 'u': /* --utc */ if (*flags & F_TIMEZONE) - exit_error(PARAMETER_PROBLEM, + xtables_error(PARAMETER_PROBLEM, "Can only specify exactly one of --localtz or --utc"); info->flags &= ~XT_TIME_LOCAL_TZ; *flags |= F_TIMEZONE; -- cgit v1.2.3