git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
examples/flow_classify: fix fseek error handling
[dpdk.git]
/
examples
/
flow_classify
/
flow_classify.c
diff --git
a/examples/flow_classify/flow_classify.c
b/examples/flow_classify/flow_classify.c
index
e4cabdb
..
766f1dd
100644
(file)
--- a/
examples/flow_classify/flow_classify.c
+++ b/
examples/flow_classify/flow_classify.c
@@
-657,13
+657,17
@@
add_rules(const char *rule_path, struct flow_classifier *cls_app)
unsigned int i = 0;
unsigned int total_num = 0;
struct rte_eth_ntuple_filter ntuple_filter;
unsigned int i = 0;
unsigned int total_num = 0;
struct rte_eth_ntuple_filter ntuple_filter;
+ int ret;
fh = fopen(rule_path, "rb");
if (fh == NULL)
fh = fopen(rule_path, "rb");
if (fh == NULL)
- rte_exit(EXIT_FAILURE, "%s:
O
pen %s failed\n", __func__,
+ rte_exit(EXIT_FAILURE, "%s:
fo
pen %s failed\n", __func__,
rule_path);
rule_path);
- fseek(fh, 0, SEEK_SET);
+ ret = fseek(fh, 0, SEEK_SET);
+ if (ret)
+ rte_exit(EXIT_FAILURE, "%s: fseek %d failed\n", __func__,
+ ret);
i = 0;
while (fgets(buff, LINE_MAX, fh) != NULL) {
i = 0;
while (fgets(buff, LINE_MAX, fh) != NULL) {