From 3551c882c7d62e991f977f4e8a5b7571740834ea Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 8 Nov 1998 17:26:23 +0000 Subject: [PATCH] Don't try to use TIOCGWINSZ unless it's defined. initialize_client() should return void. Fix and forward declaration. --- clients/ud/main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/clients/ud/main.c b/clients/ud/main.c index 4e82430a8e..b1c780d06b 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -78,6 +78,9 @@ LDAPFiltDesc *lfdp; /* LDAP filter descriptor */ int debug; /* debug flag */ #endif +extern void initialize_client(); +extern void initialize_attribute_strings(); + main(argc, argv) int argc; char *argv[]; @@ -86,7 +89,6 @@ char *argv[]; extern char *optarg; /* for parsing argv */ register int c; /* for parsing argv */ register char *cp; /* for parsing Version */ - extern void initialize_attribute_strings(); verbose = 1; @@ -539,7 +541,7 @@ char **base, *s; } } -initialize_client() +void initialize_client() { FILE *fp; /* for config file */ static char buffer[MED_BUF_SIZE]; /* for input */ @@ -689,11 +691,13 @@ initialize_client() if (((term = getenv("TERM")) == NULL) || (tgetent(bp, term) <= 0)) return; else { +#ifdef TIOCGWINSZ if (ioctl(fileno(stdout), TIOCGWINSZ, &win) < 0) { lpp = tgetnum("li"); col_size = tgetnum("co"); - } - else { + } else +#endif + { if ((lpp = win.ws_row) == 0) lpp = tgetnum("li"); if ((col_size = win.ws_col) == 0) -- 2.39.5