summaryrefslogtreecommitdiff
path: root/usr.bin/resizewin
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2017-05-07 09:19:42 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2017-05-07 09:19:42 +0000
commit46f44afb63c627d1a45c787f426a73e12676ae3a (patch)
tree513d2f2d40c197a52f8f107ac448db9c49287da7 /usr.bin/resizewin
parent5ffea91ec544d687ee5f55b66803dc1ffe900cfa (diff)
downloadsrc-test2-46f44afb63c627d1a45c787f426a73e12676ae3a.tar.gz
src-test2-46f44afb63c627d1a45c787f426a73e12676ae3a.zip
Notes
Diffstat (limited to 'usr.bin/resizewin')
-rw-r--r--usr.bin/resizewin/resizewin.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/resizewin/resizewin.c b/usr.bin/resizewin/resizewin.c
index 5399ad33a0e4..8bfa78608f48 100644
--- a/usr.bin/resizewin/resizewin.c
+++ b/usr.bin/resizewin/resizewin.c
@@ -31,6 +31,7 @@
__FBSDID("$FreeBSD$");
#include <sys/ioctl.h>
#include <sys/time.h>
+#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
@@ -87,8 +88,7 @@ main(__unused int argc, __unused char **argv)
gettimeofday(&now, NULL);
timersub(&now, &then, &now);
if (now.tv_sec >= 2) {
- fprintf(stderr, "\n\n\nTimeout reading from terminal\n");
- fprintf(stderr, "Read %d bytes, %s\n", cnt, data);
+ warnx("timeout reading from terminal");
err = 1;
goto out;
}
@@ -104,7 +104,7 @@ main(__unused int argc, __unused char **argv)
cnt++;
if (cnt == sizeof(data) - 2) {
- fprintf(stderr, "Response too long\n");
+ warnx("response too long");
err = 1;
goto out;
}
@@ -113,7 +113,7 @@ main(__unused int argc, __unused char **argv)
/* Parse */
if (sscanf(data, "\033[%hu;%huR", &w.ws_row, &w.ws_col) != 2) {
err = 1;
- fprintf(stderr, "Unable to parse response\n");
+ warnx("unable to parse response");
goto out;
}