Commit c8d4f437 authored by Jiri Popelka's avatar Jiri Popelka

The return value of nameif was wrong

Steps to Reproduce:
/sbin/nameif eth1 00:00:10:10:11:11; echo $?

Actual Results:
interface 'eth1' not found
0

Expected Results:
interface 'eth1' not found
1
parent 81d60e09
...@@ -210,6 +210,7 @@ int main(int ac, char **av) ...@@ -210,6 +210,7 @@ int main(int ac, char **av)
int linenum; int linenum;
char *line = NULL; char *line = NULL;
size_t linel = 0; size_t linel = 0;
int ret = 0;
for (;;) { for (;;) {
int c = getopt_long(ac,av,"c:s",lopt,NULL); int c = getopt_long(ac,av,"c:s",lopt,NULL);
...@@ -288,13 +289,15 @@ int main(int ac, char **av) ...@@ -288,13 +289,15 @@ int main(int ac, char **av)
while (clist) { while (clist) {
struct change *ch = clist; struct change *ch = clist;
clist = clist->next; clist = clist->next;
if (!ch->found) if (!ch->found){
warning(_("interface '%s' not found"), ch->ifname); warning(_("interface '%s' not found"), ch->ifname);
ret = 1;
}
free(ch); free(ch);
} }
if (use_syslog) if (use_syslog)
closelog(); closelog();
return 0; return ret;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment