mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 05:14:46 -04:00
Use AF_INET socketpair to test sendfile on Solaris
This commit is contained in:
parent
57b30cd7cc
commit
9b60209675
@ -617,8 +617,15 @@ test_evbuffer_add_file(void *ptr)
|
|||||||
TT_DIE(("Didn't recognize the implementation"));
|
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)
|
if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
|
||||||
tt_abort_msg("socketpair failed");
|
tt_abort_msg("socketpair failed");
|
||||||
|
#endif
|
||||||
|
|
||||||
datalen = strlen(data);
|
datalen = strlen(data);
|
||||||
fd = regress_make_tmpfile(data, datalen);
|
fd = regress_make_tmpfile(data, datalen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user