]> granicus.if.org Git - libevent/commitdiff
Use AF_INET socketpair to test sendfile on Solaris
authorNick Mathewson <nickm@torproject.org>
Fri, 6 Aug 2010 17:03:17 +0000 (13:03 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 6 Aug 2010 17:03:17 +0000 (13:03 -0400)
test/regress_buffer.c

index 38ed1a6048f086a0e2eab0a11553302593048496..ea97d126090dadc8308d269dc0ef838819794485 100644 (file)
@@ -617,8 +617,15 @@ test_evbuffer_add_file(void *ptr)
                TT_DIE(("Didn't recognize the implementation"));
        }
 
+#if defined(_EVENT_HAVE_SENDFILE) && defined(__sun__) && defined(__svr4__)
+       /* We need to use a pair of AF_INET sockets, since Solaris
+          doesn't support sendfile() over AF_UNIX. */
+       if (evutil_ersatz_socketpair(AF_INET, SOCK_STREAM, 0, pair) == -1)
+               tt_abort_msg("ersatz_socketpair failed");
+#else
        if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
                tt_abort_msg("socketpair failed");
+#endif
 
        datalen = strlen(data);
        fd = regress_make_tmpfile(data, datalen);