[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190801004506.9049-4-stephen@networkplumber.org>
Date: Wed, 31 Jul 2019 17:45:05 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: jiri@...nulli.us, chrism@...lanox.com
Cc: netdev@...r.kernel.org,
Stephen Hemminger <stephen@...workplumber.org>
Subject: [RFC iproute2 3/4] Revert "tc: fix batch force option"
This reverts commit b133392468d1f404077a8f3554d1f63d48bb45e8.
---
tc/tc.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/tc/tc.c b/tc/tc.c
index c115155b2234..b7b6bd288897 100644
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -334,7 +334,6 @@ static int batch(const char *name)
int batchsize = 0;
size_t len = 0;
int ret = 0;
- int err;
bool send;
batch_mode = 1;
@@ -403,9 +402,9 @@ static int batch(const char *name)
continue; /* blank line */
}
- err = do_cmd(largc, largv, tail == NULL ? NULL : tail->buf,
+ ret = do_cmd(largc, largv, tail == NULL ? NULL : tail->buf,
tail == NULL ? 0 : sizeof(tail->buf));
- if (err != 0) {
+ if (ret != 0) {
fprintf(stderr, "Command failed %s:%d\n", name,
cmdlineno - 1);
ret = 1;
@@ -427,17 +426,15 @@ static int batch(const char *name)
iov->iov_len = n->nlmsg_len;
}
- err = rtnl_talk_iov(&rth, iovs, batchsize, NULL);
- put_batch_bufs(&buf_pool, &head, &tail);
- free(iovs);
- if (err < 0) {
+ ret = rtnl_talk_iov(&rth, iovs, batchsize, NULL);
+ if (ret < 0) {
fprintf(stderr, "Command failed %s:%d\n", name,
- cmdlineno - (batchsize + err) - 1);
- ret = 1;
- if (!force)
- break;
+ cmdlineno - (batchsize + ret) - 1);
+ return 2;
}
+ put_batch_bufs(&buf_pool, &head, &tail);
batchsize = 0;
+ free(iovs);
}
} while (!lastline);
--
2.20.1
Powered by blists - more mailing lists