Switch from pipe to socketpair for consistency.

This commit is contained in:
Ian Gulliver
2016-03-07 14:52:10 -08:00
parent 46696933aa
commit db271db748

View File

@@ -5,6 +5,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/epoll.h> #include <sys/epoll.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include "log.h" #include "log.h"
@@ -33,7 +35,7 @@ void peer_init() {
assert(peer_epoll_fd >= 0); assert(peer_epoll_fd >= 0);
int shutdown_fds[2]; int shutdown_fds[2];
assert(!pipe2(shutdown_fds, O_CLOEXEC)); assert(!socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, shutdown_fds));
struct peer *shutdown_peer = malloc(sizeof(*shutdown_peer)); struct peer *shutdown_peer = malloc(sizeof(*shutdown_peer));
assert(shutdown_peer); assert(shutdown_peer);