From 7959df275801c705551e0fcb5f0168eb9312836d Mon Sep 17 00:00:00 2001 From: Chris Kuethe Date: Wed, 28 Oct 2009 05:14:01 +0000 Subject: poll events must be reinitialized after each call to poll. fixes ldattach exiting when relaying (nmea to gpsd, for example). ok deraadt@ --- sbin/ldattach/ldattach.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sbin/ldattach') diff --git a/sbin/ldattach/ldattach.c b/sbin/ldattach/ldattach.c index bf24ca565b4..5c73d50190d 100644 --- a/sbin/ldattach/ldattach.c +++ b/sbin/ldattach/ldattach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldattach.c,v 1.12 2009/05/06 18:21:23 stevesk Exp $ */ +/* $OpenBSD: ldattach.c,v 1.13 2009/10/28 05:14:00 ckuethe Exp $ */ /* * Copyright (c) 2007, 2008 Marc Balmer @@ -70,16 +70,16 @@ relay(int device, int pty) char buf[128]; pfd[0].fd = device; - pfd[0].events = POLLRDNORM; pfd[1].fd = pty; - pfd[1].events = POLLRDNORM; while (!dying) { + pfd[0].events = POLLRDNORM; + pfd[1].events = POLLRDNORM; nfds = poll(pfd, 2, INFTIM); if (nfds == -1) { syslog(LOG_ERR, "polling error"); exit(1); - } + } if (nfds == 0) /* should not happen */ continue; -- cgit v1.2.3