Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 May 2017 08:06:00 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r318727 - stable/11/usr.bin/resizewin
Message-ID:  <201705230806.v4N860X4095232@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Tue May 23 08:06:00 2017
New Revision: 318727
URL: https://svnweb.freebsd.org/changeset/base/318727

Log:
  MFC r317933:
  
  Use tcflush(3) instead of (nonstandard) TIOCFLUSH.

Modified:
  stable/11/usr.bin/resizewin/resizewin.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/resizewin/resizewin.c
==============================================================================
--- stable/11/usr.bin/resizewin/resizewin.c	Tue May 23 08:04:36 2017	(r318726)
+++ stable/11/usr.bin/resizewin/resizewin.c	Tue May 23 08:06:00 2017	(r318727)
@@ -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?201705230806.v4N860X4095232>