Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jan 2003 18:34:35 -0800 (PST)
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 23075 for review
Message-ID:  <200301030234.h032YZn3047856@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=23075

Change 23075 by des@des.at.des.thinksec.com on 2003/01/02 18:34:13

	Have prompt() return NULL if EOF occurred on stdin, instead of acting
	as if the user had just pressed enter.
	
	Obtained from:	TrustedBSD

Affected files ...

.. //depot/projects/openpam/lib/openpam_ttyconv.c#15 edit

Differences ...

==== //depot/projects/openpam/lib/openpam_ttyconv.c#15 (text+ko) ====

@@ -31,7 +31,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $P4: //depot/projects/openpam/lib/openpam_ttyconv.c#14 $
+ * $P4: //depot/projects/openpam/lib/openpam_ttyconv.c#15 $
  */
 
 #include <sys/types.h>
@@ -89,7 +89,7 @@
 	sigaction(SIGALRM, &saved_action, NULL);
 	sigprocmask(SIG_SETMASK, &saved_sigset, NULL);
 	alarm(saved_alarm);
-	if (timed_out || ferror(stdin))
+	if (timed_out || ferror(stdin) || feof(stdin))
 		return (NULL);
 	/* trim trailing whitespace */
 	for (len = strlen(buf); len > 0; --len)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301030234.h032YZn3047856>