projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid warnings about comparisons that are always true.
[openvswitch]
/
utilities
/
ovs-ofctl.c
diff --git
a/utilities/ovs-ofctl.c
b/utilities/ovs-ofctl.c
index 201a9633bd5b075c4d43bbd1e73f947c0399fa3f..bc8cc6bd8e8391b22d1d6d1c8b66d5cf3b3f3f3b 100644
(file)
--- a/
utilities/ovs-ofctl.c
+++ b/
utilities/ovs-ofctl.c
@@
-199,17
+199,8
@@
static void run(int retval, const char *message, ...)
if (retval) {
va_list args;
if (retval) {
va_list args;
- fprintf(stderr, "%s: ", program_name);
va_start(args, message);
va_start(args, message);
- vfprintf(stderr, message, args);
- va_end(args);
- if (retval == EOF) {
- fputs(": unexpected end of file\n", stderr);
- } else {
- fprintf(stderr, ": %s\n", strerror(retval));
- }
-
- exit(EXIT_FAILURE);
+ ovs_fatal_valist(retval, message, args);
}
}
\f
}
}
\f
@@
-836,9
+827,9
@@
do_ping(int argc, char *argv[])
OFPT_ECHO_REQUEST, &request);
random_bytes(rq_hdr + 1, payload);
OFPT_ECHO_REQUEST, &request);
random_bytes(rq_hdr + 1, payload);
-
gettimeofday(&start, NULL
);
+
xgettimeofday(&start
);
run(vconn_transact(vconn, ofpbuf_clone(request), &reply), "transact");
run(vconn_transact(vconn, ofpbuf_clone(request), &reply), "transact");
-
gettimeofday(&end, NULL
);
+
xgettimeofday(&end
);
rpy_hdr = reply->data;
if (reply->size != request->size
rpy_hdr = reply->data;
if (reply->size != request->size
@@
-883,7
+874,7
@@
do_benchmark(int argc OVS_UNUSED, char *argv[])
count, message_size, count * message_size);
open_vconn(argv[1], &vconn);
count, message_size, count * message_size);
open_vconn(argv[1], &vconn);
-
gettimeofday(&start, NULL
);
+
xgettimeofday(&start
);
for (i = 0; i < count; i++) {
struct ofpbuf *request, *reply;
struct ofp_header *rq_hdr;
for (i = 0; i < count; i++) {
struct ofpbuf *request, *reply;
struct ofp_header *rq_hdr;
@@
-893,7
+884,7
@@
do_benchmark(int argc OVS_UNUSED, char *argv[])
run(vconn_transact(vconn, request, &reply), "transact");
ofpbuf_delete(reply);
}
run(vconn_transact(vconn, request, &reply), "transact");
ofpbuf_delete(reply);
}
-
gettimeofday(&end, NULL
);
+
xgettimeofday(&end
);
vconn_close(vconn);
duration = ((1000*(double)(end.tv_sec - start.tv_sec))
vconn_close(vconn);
duration = ((1000*(double)(end.tv_sec - start.tv_sec))