From 0f23cb47eca5cddce63081e10be18eece9a8428d Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Sun, 21 Dec 2003 18:18:22 +0000 Subject: use pipe(2)s instead of socketpair(2)s. suggested by tedu@ for a performance gain, ok claudio@ --- usr.sbin/bgpd/bgpd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index c8dab2e354f..f96b28e1487 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.8 2003/12/20 21:26:48 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.9 2003/12/21 18:18:21 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -155,18 +155,18 @@ main(int argc, char *argv[]) logit(LOG_INFO, "startup"); - if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_m2s) == -1) - fatal("socketpair", errno); + if (pipe(pipe_m2s) == -1) + fatal("pipe", errno); if (fcntl(pipe_m2s[0], F_SETFL, O_NONBLOCK) == -1 || fcntl(pipe_m2s[1], F_SETFL, O_NONBLOCK) == -1) fatal("fcntl", errno); - if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_m2r) == -1) - fatal("socketpair", errno); + if (pipe(pipe_m2r) == -1) + fatal("pipe", errno); if (fcntl(pipe_m2r[0], F_SETFL, O_NONBLOCK) == -1 || fcntl(pipe_m2r[1], F_SETFL, O_NONBLOCK) == -1) fatal("fcntl", errno); - if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_s2r) == -1) - fatal("socketpair", errno); + if (pipe(pipe_s2r) == -1) + fatal("pipe", errno); if (fcntl(pipe_s2r[0], F_SETFL, O_NONBLOCK) == -1 || fcntl(pipe_s2r[1], F_SETFL, O_NONBLOCK) == -1) fatal("fcntl", errno); -- cgit v1.2.3