[PATCH 30/31] more: remove TIOCGWINSZ preprocessor #ifdef checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The change_window_sz(), that used to be chgwinsz(), has done assumption
TIOCGWINSZ without check for long time.  It is time to remove the rest of
the #ifdefs.

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 text-utils/more.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/text-utils/more.c b/text-utils/more.c
index 449f9cd..f349109 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -1793,9 +1793,7 @@ static void initterm(struct more_control *ctl)
 {
 	int ret, tmp;
 	char *term;
-#ifdef TIOCGWINSZ
 	struct winsize win;
-#endif
 
 #ifndef NON_INTERACTIVE_MORE
 	ctl->no_tty = tcgetattr(STDOUT_FILENO, &ctl->otty);
@@ -1812,19 +1810,15 @@ static void initterm(struct more_control *ctl)
 			ctl->dumb = 1;
 			ctl->ul_opt = 0;
 		} else {
-#ifdef TIOCGWINSZ
 			if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) < 0) {
-#endif
 				ctl->lines_per_page = my_tgetnum(TERM_LINES);
 				ctl->ncolumns = my_tgetnum(TERM_COLS);
-#ifdef TIOCGWINSZ
 			} else {
 				if ((ctl->lines_per_page = win.ws_row) == 0)
 					ctl->lines_per_page = my_tgetnum(TERM_LINES);
 				if ((ctl->ncolumns = win.ws_col) == 0)
 					ctl->ncolumns = my_tgetnum(TERM_COLS);
 			}
-#endif
 			if ((ctl->lines_per_page <= 0) || my_tgetflag(TERM_HARD_COPY)) {
 				ctl->hard_term = 1;
 				ctl->lines_per_page = LINES_PER_PAGE;
-- 
2.3.0

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux