summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2013-05-30 21:26:23 +0000
committerTed Ross <tross@apache.org>2013-05-30 21:26:23 +0000
commitb7d4735fa7140f9c0d978d3579d98e3452022131 (patch)
tree1a2d65e0ee60de6f6b4438e3b3cb5e98f6dd5d84
parent3232fb9b7376f74de4b5f95a9c9a0030e6ecb09e (diff)
downloadqpid-python-b7d4735fa7140f9c0d978d3579d98e3452022131.tar.gz
NO-JIRA - Replace use of "pipe2" with "pipe" because pipe2 is not available on RHEL5.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1488018 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/extras/dispatch/tests/server_test.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/qpid/extras/dispatch/tests/server_test.c b/qpid/extras/dispatch/tests/server_test.c
index 4f68ecb421..8c922a5eac 100644
--- a/qpid/extras/dispatch/tests/server_test.c
+++ b/qpid/extras/dispatch/tests/server_test.c
@@ -159,7 +159,17 @@ static char* test_user_fd(void *context)
dx_timer_schedule(timer, 0);
stored_error[0] = 0x0;
- res = pipe2(fd, O_NONBLOCK);
+
+ res = pipe(fd); // Don't use pipe2 because it's not available on RHEL5
+ for (int i = 0; i < 2; i++) {
+ int flags = fcntl(fd[i], F_GETFL);
+ flags |= O_NONBLOCK;
+ if (fcntl(fd[i], F_SETFL, flags) < 0) {
+ perror("fcntl");
+ return "Failed to set socket to non-blocking";
+ }
+ }
+
if (res != 0) return "Error creating pipe2";
ufd_write = dx_user_fd(dx, fd[1], (void*) 1);