summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b64c051)
raw | patch | inline | side by side (parent: b64c051)
author | Maryam Tahhan <maryam.tahhan@intel.com> | |
Tue, 7 Jun 2016 11:46:52 +0000 (12:46 +0100) | ||
committer | Kim Jones <kim-marie.jones@intel.com> | |
Thu, 28 Jul 2016 12:23:46 +0000 (13:23 +0100) |
This commit cleans up and fixes the pipe creation, and improves the
error checking.
Change-Id: I53de4a7ff450aea349971f58fe5cce8904da1e89
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
error checking.
Change-Id: I53de4a7ff450aea349971f58fe5cce8904da1e89
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
src/dpdkstat.c | patch | blob | history |
diff --git a/src/dpdkstat.c b/src/dpdkstat.c
index 903523f20892ef4df67c664a067e48c1c94891ef..e5aafdeb822930cb34373272c2fdc6e8558945e6 100644 (file)
--- a/src/dpdkstat.c
+++ b/src/dpdkstat.c
return -1;
}
- int pipe0_flags = fcntl(g_configuration->helper_pipes[1], F_GETFL, 0);
- int pipe1_flags = fcntl(g_configuration->helper_pipes[0], F_GETFL, 0);
- int p1err = fcntl(g_configuration->helper_pipes[1], F_SETFL, pipe1_flags | O_NONBLOCK);
- int p2err = fcntl(g_configuration->helper_pipes[0], F_SETFL, pipe0_flags | O_NONBLOCK);
- if (pipe0_flags == -1 || pipe1_flags == -1 || p1err == -1 || p2err == -1) {
+ int pipe0_flags = fcntl(g_configuration->helper_pipes[0], F_GETFL, 0);
+ int pipe1_flags = fcntl(g_configuration->helper_pipes[1], F_GETFL, 0);
+ if (pipe0_flags == -1 || pipe1_flags == -1) {
+ ERROR("dpdkstat: error setting up pipe flags: %s\n", strerror(errno));
+ }
+ int pipe0_err = fcntl(g_configuration->helper_pipes[0], F_SETFL, pipe1_flags
+ | O_NONBLOCK);
+ int pipe1_err = fcntl(g_configuration->helper_pipes[1], F_SETFL, pipe0_flags
+ | O_NONBLOCK);
+ if (pipe0_err == -1 || pipe1_err == -1) {
ERROR("dpdkstat: error setting up pipes: %s\n", strerror(errno));
}