summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthorpej <thorpej@pkgsrc.org>2000-08-02 17:33:45 +0000
committerthorpej <thorpej@pkgsrc.org>2000-08-02 17:33:45 +0000
commite6b1b2f82d5944dd4f669cb2c2a3de5fac552753 (patch)
tree6ecf403183c5270ef06161a95b4ccb50671fb9bd
parent7310479a973a8730bc53c0b0ca2095b950144620 (diff)
downloadpkgsrc-e6b1b2f82d5944dd4f669cb2c2a3de5fac552753.tar.gz
Put some more duct tape on the last. Should fix a problem
reported by Manuel Bouyer.
-rw-r--r--sysutils/rtty/files/patch-sum4
-rw-r--r--sysutils/rtty/patches/patch-ac18
2 files changed, 13 insertions, 9 deletions
diff --git a/sysutils/rtty/files/patch-sum b/sysutils/rtty/files/patch-sum
index b6194eb6125..e868551873f 100644
--- a/sysutils/rtty/files/patch-sum
+++ b/sysutils/rtty/files/patch-sum
@@ -1,6 +1,6 @@
-$NetBSD: patch-sum,v 1.3 2000/08/02 05:02:14 thorpej Exp $
+$NetBSD: patch-sum,v 1.4 2000/08/02 17:33:45 thorpej Exp $
MD5 (patch-aa) = b036e6deb90550cb648ec406030eb27c
MD5 (patch-ab) = 7db5d365d595a97a0f6abe5037650d47
-MD5 (patch-ac) = 69d7b57b6b5f2fefbee34d01bb7226bd
+MD5 (patch-ac) = 95547bc382b193e33888782c4c298c0e
MD5 (patch-ad) = 77e54c5a69059488b300f752c693744d
diff --git a/sysutils/rtty/patches/patch-ac b/sysutils/rtty/patches/patch-ac
index 92618224abb..41cb6a14b8e 100644
--- a/sysutils/rtty/patches/patch-ac
+++ b/sysutils/rtty/patches/patch-ac
@@ -1,4 +1,4 @@
-$NetBSD: patch-ac,v 1.2 2000/08/02 05:02:15 thorpej Exp $
+$NetBSD: patch-ac,v 1.3 2000/08/02 17:33:45 thorpej Exp $
Make this compile on Solaris.
@@ -6,7 +6,7 @@ Fix a bug where rtty would loop forever if its parent process
(such as a shell) were to die and close rtty's standard input.
--- rtty.c.orig Fri Aug 23 15:25:28 1996
-+++ rtty.c Tue Aug 1 21:50:19 2000
++++ rtty.c Wed Aug 2 10:25:30 2000
@@ -35,6 +35,10 @@
#include <pwd.h>
#include <termios.h>
@@ -18,11 +18,13 @@ Fix a bug where rtty would loop forever if its parent process
#include "rtty.h"
#ifdef NEED_BITYPES_H
# include "bitypes.h"
-@@ -267,11 +271,12 @@
+@@ -266,13 +270,16 @@
+ static void
tty_input(fd) {
static enum {base, need_cr, tilde} state = base;
- u_char buf[1];
+ ssize_t cnt;
++ int readone = 0;
+ u_char buf[1];
#if 0
fcntl(Tty, F_SETFL, fcntl(Tty, F_GETFL, 0)|O_NONBLOCK);
@@ -30,16 +32,18 @@ Fix a bug where rtty would loop forever if its parent process
- while (1 == read(fd, buf, 1)) {
+ while (1 == (cnt = read(fd, buf, 1))) {
u_char ch = buf[0];
++ readone = 1;
switch (state) {
-@@ -346,6 +351,14 @@
+ case base:
+@@ -346,6 +353,14 @@
write(Log, buf, 1);
}
}
+
-+ if (cnt == 0) {
++ if (readone == 0 && cnt == 0) {
+ /*
-+ * EOF -- get out now rather than loop forever.
++ * True EOF -- get out now rather than loop forever.
+ */
+ quit(0);
+ }