From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Meier Date: Thu, 7 Aug 2014 14:15:09 +0200 Subject: [U-Boot] [PATCH] tools: genboardscfg.py, use default terminal size if undetectable In-Reply-To: <20140807113720.GS19374@bill-the-cat> References: <20140807113720.GS19374@bill-the-cat> Message-ID: <1407413709-23005-1-git-send-email-roger@bufferoverflow.ch> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The existing terminalsize detection raised an exception on build server. Removes the exception and return a default value. Signed-off-by: Roger Meier CC: Masahiro Yamada CC: Tom Rini --- Changes for v2: - use 24 instead of 25 lines --- tools/genboardscfg.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py index 734d90b..283c989 100755 --- a/tools/genboardscfg.py +++ b/tools/genboardscfg.py @@ -58,11 +58,9 @@ def get_terminal_columns(): try: ret = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ, arg) except IOError as exception: - if exception.errno != errno.ENOTTY: - raise # If 'Inappropriate ioctl for device' error occurs, - # stdout is probably redirected. Return 0. - return 0 + # stdout is probably redirected. Return default size. + return (24, 80) return struct.unpack('hhhh', ret)[1] def get_devnull(): @@ -408,7 +406,7 @@ def __gen_boards_cfg(jobs): jobs: The number of jobs to run simultaneously Note: - The incomplete boards.cfg is left over when an error (including + The incomplete boards.cfg is left over when an error (including the termination by the keyboard interrupt) occurs on the halfway. """ check_top_directory() -- 1.7.10.4