ipfw: correctly report table manipulation errors
Let ipfw(8) report the actual error instead of the error that may have come from calling printf(). Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1221
This commit is contained in:
parent
12be6f12e8
commit
09025a7147
|
@ -1037,6 +1037,9 @@ table_modify_record(ipfw_obj_header *oh, int ac, char *av[], int add,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get real OS error */
|
||||||
|
error = errno;
|
||||||
|
|
||||||
/* Report results back */
|
/* Report results back */
|
||||||
ptent = tent_buf;
|
ptent = tent_buf;
|
||||||
for (i = 0; i < count; ptent++, i++) {
|
for (i = 0; i < count; ptent++, i++) {
|
||||||
|
@ -1089,8 +1092,6 @@ table_modify_record(ipfw_obj_header *oh, int ac, char *av[], int add,
|
||||||
|
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
return;
|
return;
|
||||||
/* Get real OS error */
|
|
||||||
error = errno;
|
|
||||||
|
|
||||||
/* Try to provide more human-readable error */
|
/* Try to provide more human-readable error */
|
||||||
switch (error) {
|
switch (error) {
|
||||||
|
|
Loading…
Reference in New Issue