Date: Tue, 23 May 2017 08:01:24 +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: r318724 - stable/11/usr.bin/resizewin Message-ID: <201705230801.v4N81OYI092799@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Tue May 23 08:01:24 2017 New Revision: 318724 URL: https://svnweb.freebsd.org/changeset/base/318724 Log: MFC r317901: Improve error reporting in resizewin(1). 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:01:11 2017 (r318723) +++ stable/11/usr.bin/resizewin/resizewin.c Tue May 23 08:01:24 2017 (r318724) @@ -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 ** 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 ** 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 ** /* 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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705230801.v4N81OYI092799>