svn commit: r317905 - head/usr.bin/resizewin
Edward Tomasz Napierala
trasz at FreeBSD.org
Sun May 7 12:08:43 UTC 2017
Author: trasz
Date: Sun May 7 12:08:41 2017
New Revision: 317905
URL: https://svnweb.freebsd.org/changeset/base/317905
Log:
Rename a variable, hopefully fixing build after r317901.
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 Sun May 7 11:44:25 2017 (r317904)
+++ head/usr.bin/resizewin/resizewin.c Sun May 7 12:08:41 2017 (r317905)
@@ -52,11 +52,11 @@ main(__unused int argc, __unused char **
{
struct termios old, new;
struct winsize w;
- int ret, fd, cnt, err;
+ int ret, fd, cnt, error;
char data[20];
struct timeval then, now;
- err = 0;
+ error = 0;
if ((fd = open("/dev/tty", O_RDWR | O_NONBLOCK)) == -1)
exit(1);
@@ -72,7 +72,7 @@ main(__unused int argc, __unused char **
exit(1);
if (write(fd, query, sizeof(query)) != sizeof(query)) {
- err = 1;
+ error = 1;
goto out;
}
@@ -89,14 +89,14 @@ main(__unused int argc, __unused char **
timersub(&now, &then, &now);
if (now.tv_sec >= 2) {
warnx("timeout reading from terminal");
- err = 1;
+ error = 1;
goto out;
}
usleep(20000);
continue;
}
- err = 1;
+ error = 1;
goto out;
}
if (data[cnt] == 'R')
@@ -105,25 +105,25 @@ main(__unused int argc, __unused char **
cnt++;
if (cnt == sizeof(data) - 2) {
warnx("response too long");
- err = 1;
+ error = 1;
goto out;
}
}
/* Parse */
if (sscanf(data, "\033[%hu;%huR", &w.ws_row, &w.ws_col) != 2) {
- err = 1;
+ error = 1;
warnx("unable to parse response");
goto out;
}
/* Finally, what we want */
if (ioctl(fd, TIOCSWINSZ, &w) == -1)
- err = 1;
+ error = 1;
out:
/* Restore echo */
tcsetattr(fd, TCSANOW, &old);
close(fd);
- exit(err);
+ exit(error);
}
More information about the svn-src-head
mailing list