summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Kuethe <ckuethe@cvs.openbsd.org>2009-10-28 05:14:01 +0000
committerChris Kuethe <ckuethe@cvs.openbsd.org>2009-10-28 05:14:01 +0000
commit7959df275801c705551e0fcb5f0168eb9312836d (patch)
tree24df1df57eb10780b2a6537869b22fd4a9fb8393
parenta6cb6979efc28a532c4d1db21754da946457e144 (diff)
poll events must be reinitialized after each call to poll. fixes
ldattach exiting when relaying (nmea to gpsd, for example). ok deraadt@
-rw-r--r--sbin/ldattach/ldattach.c8
1 files changed, 4 insertions, 4 deletions
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 <mbalmer@openbsd.org>
@@ -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;