diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c index 7901950acad..4c783e02f85 100644 --- a/sbin/ipfw/tables.c +++ b/sbin/ipfw/tables.c @@ -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 */ ptent = tent_buf; 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) return; - /* Get real OS error */ - error = errno; /* Try to provide more human-readable error */ switch (error) {