From owner-svn-src-all@FreeBSD.ORG Tue Jan 14 22:56:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C68AE99; Tue, 14 Jan 2014 22:56:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5C5D212CB; Tue, 14 Jan 2014 22:56:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0EMuQP4007800; Tue, 14 Jan 2014 22:56:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0EMuPOi007794; Tue, 14 Jan 2014 22:56:25 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201401142256.s0EMuPOi007794@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 14 Jan 2014 22:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260654 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jan 2014 22:56:26 -0000 Author: jilles Date: Tue Jan 14 22:56:25 2014 New Revision: 260654 URL: http://svnweb.freebsd.org/changeset/base/260654 Log: sh: Remove SIGWINCH handler and just check for resize before every read. The SIGWINCH handler triggers breakage in libedit which is hard to fix; see PR bin/169773. Also, window size changes while a program is in foreground (and it rather than sh will receive SIGWINCH) will now be picked up automatically. Downside: it is now certain that a resize is only processed after pressing . If libedit is fixed, sh will most likely have to be changed also. PR: bin/180146 Modified: head/bin/sh/input.c head/bin/sh/trap.c head/bin/sh/trap.h Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Tue Jan 14 22:46:23 2014 (r260653) +++ head/bin/sh/input.c Tue Jan 14 22:56:25 2014 (r260654) @@ -162,20 +162,16 @@ preadfd(void) int nr; parsenextc = parsefile->buf; -#ifndef NO_HISTORY - if (el != NULL && gotwinch) { - gotwinch = 0; - el_resize(el); - } -#endif retry: #ifndef NO_HISTORY if (parsefile->fd == 0 && el) { static const char *rl_cp; static int el_len; - if (rl_cp == NULL) + if (rl_cp == NULL) { + el_resize(el); rl_cp = el_gets(el, &el_len); + } if (rl_cp == NULL) nr = el_len == 0 ? 0 : -1; else { Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Tue Jan 14 22:46:23 2014 (r260653) +++ head/bin/sh/trap.c Tue Jan 14 22:56:25 2014 (r260654) @@ -80,7 +80,6 @@ static char *volatile trap[NSIG]; /* tra static volatile sig_atomic_t gotsig[NSIG]; /* indicates specified signal received */ static int ignore_sigchld; /* Used while handling SIGCHLD traps. */ -volatile sig_atomic_t gotwinch; static int last_trapsig; static int exiting; /* exitshell() has been called */ @@ -293,12 +292,6 @@ setsignal(int signo) action = S_IGN; break; #endif -#ifndef NO_HISTORY - case SIGWINCH: - if (rootshell && iflag) - action = S_CATCH; - break; -#endif } } @@ -400,11 +393,6 @@ onsig(int signo) gotsig[signo] = 1; pendingsig = signo; } - -#ifndef NO_HISTORY - if (signo == SIGWINCH) - gotwinch = 1; -#endif } @@ -490,9 +478,6 @@ setinteractive(int on) setsignal(SIGINT); setsignal(SIGQUIT); setsignal(SIGTERM); -#ifndef NO_HISTORY - setsignal(SIGWINCH); -#endif is_interactive = on; } Modified: head/bin/sh/trap.h ============================================================================== --- head/bin/sh/trap.h Tue Jan 14 22:46:23 2014 (r260653) +++ head/bin/sh/trap.h Tue Jan 14 22:56:25 2014 (r260654) @@ -36,7 +36,6 @@ extern volatile sig_atomic_t pendingsig; extern volatile sig_atomic_t pendingsig_waitcmd; extern int in_dotrap; -extern volatile sig_atomic_t gotwinch; void clear_traps(void); int have_traps(void);