Module Name:    src
Committed By:   christos
Date:           Sat Sep 24 14:44:11 UTC 2011

Modified Files:
        src/bin/csh: file.c

Log Message:
csh has no business using TTYHOG


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/bin/csh/file.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/csh/file.c
diff -u src/bin/csh/file.c:1.28 src/bin/csh/file.c:1.29
--- src/bin/csh/file.c:1.28	Sat Feb 14 02:12:29 2009
+++ src/bin/csh/file.c	Sat Sep 24 10:44:11 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: file.c,v 1.28 2009/02/14 07:12:29 lukem Exp $ */
+/* $NetBSD: file.c,v 1.29 2011/09/24 14:44:11 christos Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)file.c	8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: file.c,v 1.28 2009/02/14 07:12:29 lukem Exp $");
+__RCSID("$NetBSD: file.c,v 1.29 2011/09/24 14:44:11 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -161,10 +161,10 @@
 pushback(Char *string)
 {
     struct termios tty, tty_normal;
-    char buf[TTYHOG], svchars[TTYHOG];
+    char buf[64], svchars[sizeof(buf)];
     sigset_t nsigset, osigset;
     Char *p;
-    int bufidx, i, len_str, nbuf, nsv, onsv, retrycnt;
+    size_t bufidx, i, len_str, nbuf, nsv, onsv, retrycnt;
     char c;
 
     nsv = 0;
@@ -195,7 +195,7 @@
 
 	if (ioctl(SHOUT, FIONREAD, (ioctl_t) &nbuf) ||
 	    nbuf <= len_str + nsv ||	/* The string fit. */
-	    nbuf > TTYHOG)		/* For future binary compatibility
+	    nbuf > sizeof(buf))		/* For future binary compatibility
 					   (and safety). */
 	    break;
 
@@ -205,7 +205,7 @@
 	 */
 
 	/* This read() should be in noncanonical mode. */
-	if (read(SHOUT, &buf, nbuf) != nbuf)
+	if (read(SHOUT, &buf, nbuf) != (ssize_t)nbuf)
 	    continue;		/* hangup? */
 
 	onsv = nsv;

Reply via email to