Author: tross
Date: Thu May 30 21:26:23 2013
New Revision: 1488018

URL: http://svn.apache.org/r1488018
Log:
NO-JIRA - Replace use of "pipe2" with "pipe" because pipe2 is not available on 
RHEL5.

Modified:
    qpid/trunk/qpid/extras/dispatch/tests/server_test.c

Modified: qpid/trunk/qpid/extras/dispatch/tests/server_test.c
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/extras/dispatch/tests/server_test.c?rev=1488018&r1=1488017&r2=1488018&view=diff
==============================================================================
--- qpid/trunk/qpid/extras/dispatch/tests/server_test.c (original)
+++ qpid/trunk/qpid/extras/dispatch/tests/server_test.c Thu May 30 21:26:23 2013
@@ -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);



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to