diff options
author | brian <brian@FreeBSD.org> | 1999-03-07 01:41:40 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-03-07 01:41:40 +0000 |
commit | e8558b0707a00d1ab53ee2cf174c1b9c15a33f29 (patch) | |
tree | 46e79ea18ed494141f9c7618d65b5323ed28dece /usr.sbin | |
parent | 2c3a4510e59d7d0cb07ef89d6da2476dfe4ba373 (diff) | |
download | FreeBSD-src-e8558b0707a00d1ab53ee2cf174c1b9c15a33f29.zip FreeBSD-src-e8558b0707a00d1ab53ee2cf174c1b9c15a33f29.tar.gz |
Read from fd[0] and write to fd[1] where `fd' is the
result of a pipe(). This matters under OpenBSD.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/bundle.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index ea8b34a..4c4d041 100644 --- a/usr.sbin/ppp/bundle.c +++ b/usr.sbin/ppp/bundle.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bundle.c,v 1.47 1999/03/01 00:43:48 brian Exp $ + * $Id: bundle.c,v 1.48 1999/03/04 17:42:14 brian Exp $ */ #include <sys/param.h> @@ -1666,9 +1666,9 @@ bundle_setsid(struct bundle *bundle, int holdsession) close(fds[1]); return; case 0: - close(fds[0]); - read(fds[1], &done, 1); /* uu_locks are mine ! */ close(fds[1]); + read(fds[0], &done, 1); /* uu_locks are mine ! */ + close(fds[0]); if (pipe(fds) == -1) { log_Printf(LogERROR, "pipe(2): %s\n", strerror(errno)); return; @@ -1680,10 +1680,10 @@ bundle_setsid(struct bundle *bundle, int holdsession) close(fds[1]); return; case 0: - close(fds[0]); - bundle_LockTun(bundle); /* update pid */ - read(fds[1], &done, 1); /* uu_locks are mine ! */ close(fds[1]); + bundle_LockTun(bundle); /* update pid */ + read(fds[0], &done, 1); /* uu_locks are mine ! */ + close(fds[0]); setsid(); log_Printf(LogPHASE, "%d -> %d: %s session control\n", (int)orig, (int)getpid(), @@ -1691,25 +1691,25 @@ bundle_setsid(struct bundle *bundle, int holdsession) timer_InitService(0); /* Start the Timer Service */ break; default: - close(fds[1]); + close(fds[0]); /* Give away all our modem locks (to the final process) */ for (dl = bundle->links; dl; dl = dl->next) if (dl->state != DATALINK_CLOSED) modem_ChangedPid(dl->physical, pid); - write(fds[0], "!", 1); /* done */ - close(fds[0]); + write(fds[1], "!", 1); /* done */ + close(fds[1]); exit(0); break; } break; default: - close(fds[1]); + close(fds[0]); /* Give away all our modem locks (to the intermediate process) */ for (dl = bundle->links; dl; dl = dl->next) if (dl->state != DATALINK_CLOSED) modem_ChangedPid(dl->physical, pid); - write(fds[0], "!", 1); /* done */ - close(fds[0]); + write(fds[1], "!", 1); /* done */ + close(fds[1]); if (holdsession) { int fd, status; |