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
commit7a1a7b9a3b652b48f2feaecb31b8989c92dc9b36 (patch)
treebb62777f2b325cc0285f835664944d1724af9107
parent3c595d945692122aaae4eeea88f668985dc14597 (diff)
downloadqpid-python-7a1a7b9a3b652b48f2feaecb31b8989c92dc9b36.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/qpid@1488018 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--extras/dispatch/tests/server_test.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/extras/dispatch/tests/server_test.c b/extras/dispatch/tests/server_test.c
index 4f68ecb421..8c922a5eac 100644
--- a/extras/dispatch/tests/server_test.c
+++ b/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);