Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 May 2017 08:34:50 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r317933 - head/usr.bin/resizewin
Message-ID:  <201705080834.v488YonF026408@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Mon May  8 08:34:50 2017
New Revision: 317933
URL: https://svnweb.freebsd.org/changeset/base/317933

Log:
  Use tcflush(3) instead of (nonstandard) TIOCFLUSH.
  
  Reported by:	kib
  MFC after:	2 weeks
  Sponsored by:	DARPA, AFRL

Modified:
  head/usr.bin/resizewin/resizewin.c

Modified: head/usr.bin/resizewin/resizewin.c
==============================================================================
--- head/usr.bin/resizewin/resizewin.c	Mon May  8 01:29:40 2017	(r317932)
+++ head/usr.bin/resizewin/resizewin.c	Mon May  8 08:34:50 2017	(r317933)
@@ -52,7 +52,7 @@ main(__unused int argc, __unused char **
 {
 	struct termios old, new;
 	struct winsize w;
-	int ret, fd, cnt, error, what;
+	int ret, fd, cnt, error;
 	char data[20];
 	struct timeval then, now;
 
@@ -72,10 +72,9 @@ main(__unused int argc, __unused char **
 		exit(1);
 
 	/* Discard input received so far */
-	what = FREAD | FWRITE;
-	error = ioctl(fd, TIOCFLUSH, &what);
+	error = tcflush(fd, TCIOFLUSH);
 	if (error != 0)
-		warn("ioctl");
+		warn("tcflush");
 
 	if (write(fd, query, sizeof(query)) != sizeof(query)) {
 		error = 1;



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