You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2013/05/30 23:26:23 UTC

svn commit: r1488018 - /qpid/trunk/qpid/extras/dispatch/tests/server_test.c

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: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org