diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2014-11-12 16:29:05 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2014-11-12 16:29:05 +0000 |
commit | fa62ecba407e2715c417c59fefbbf34d5407b613 (patch) | |
tree | 1556bc1497090692aaecdf1ba7029c7da44cbfd0 /usr.bin | |
parent | b8f0df3ea55d2e2e3ed8d1bd786435f86fb8bc3f (diff) |
Remove more portability bits for older systems; from Martin Natano
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/vi/build/port.h | 5 | ||||
-rw-r--r-- | usr.bin/vi/cl/cl.h | 14 | ||||
-rw-r--r-- | usr.bin/vi/cl/cl_funcs.c | 21 | ||||
-rw-r--r-- | usr.bin/vi/cl/cl_main.c | 14 | ||||
-rw-r--r-- | usr.bin/vi/cl/cl_screen.c | 24 | ||||
-rw-r--r-- | usr.bin/vi/cl/cl_term.c | 6 | ||||
-rw-r--r-- | usr.bin/vi/common/common.h | 8 | ||||
-rw-r--r-- | usr.bin/vi/common/exf.c | 18 | ||||
-rw-r--r-- | usr.bin/vi/common/msg.c | 158 | ||||
-rw-r--r-- | usr.bin/vi/common/recover.c | 3 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_argv.c | 20 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_cscope.c | 3 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_init.c | 3 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_script.c | 7 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_tag.c | 13 | ||||
-rw-r--r-- | usr.bin/vi/ex/script.h | 4 |
16 files changed, 33 insertions, 288 deletions
diff --git a/usr.bin/vi/build/port.h b/usr.bin/vi/build/port.h deleted file mode 100644 index 8ec6b531af2..00000000000 --- a/usr.bin/vi/build/port.h +++ /dev/null @@ -1,5 +0,0 @@ -/* $OpenBSD: port.h,v 1.4 1999/11/26 22:49:08 millert Exp $ */ - -/* - * Nothing needed here for OpenBSD. - */ diff --git a/usr.bin/vi/cl/cl.h b/usr.bin/vi/cl/cl.h index f54c5babf75..325313e859c 100644 --- a/usr.bin/vi/cl/cl.h +++ b/usr.bin/vi/cl/cl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cl.h,v 1.7 2006/01/08 21:05:39 miod Exp $ */ +/* $OpenBSD: cl.h,v 1.8 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -65,16 +65,4 @@ typedef enum { INP_OK=0, INP_EOF, INP_ERR, INP_INTR, INP_TIMEOUT } input_t; /* X11 xterm escape sequence to rename the icon/window. */ #define XTERM_RENAME "\033]0;%s\007" -/* - * XXX - * Some implementations of curses.h don't define these for us. Used for - * compatibility only. - */ -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif - #include "cl_extern.h" diff --git a/usr.bin/vi/cl/cl_funcs.c b/usr.bin/vi/cl/cl_funcs.c index 01ccc324427..17938848c21 100644 --- a/usr.bin/vi/cl/cl_funcs.c +++ b/usr.bin/vi/cl/cl_funcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_funcs.c,v 1.16 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: cl_funcs.c,v 1.17 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -287,24 +287,7 @@ cl_deleteln(SCR *sp) */ if (!F_ISSET(sp, SC_SCR_EXWROTE) && IS_SPLIT(sp)) { getyx(stdscr, oldy, oldx); -#ifdef mvchgat mvchgat(RLNO(sp, LASTLINE(sp)), 0, -1, A_NORMAL, 0, NULL); -#else - for (lno = RLNO(sp, LASTLINE(sp)), col = spcnt = 0;;) { - (void)move(lno, col); - ch = winch(stdscr); - if (isblank(ch)) - ++spcnt; - else { - (void)move(lno, col - spcnt); - for (; spcnt > 0; --spcnt) - (void)addch(' '); - (void)addch(ch); - } - if (++col >= sp->cols) - break; - } -#endif (void)move(oldy, oldx); } @@ -413,11 +396,9 @@ cl_keyval(SCR *sp, scr_keyval_t val, CHAR_T *chp, int *dnep) case KEY_VKILL: *dnep = (*chp = clp->orig.c_cc[VKILL]) == _POSIX_VDISABLE; break; -#ifdef VWERASE case KEY_VWERASE: *dnep = (*chp = clp->orig.c_cc[VWERASE]) == _POSIX_VDISABLE; break; -#endif default: *dnep = 1; break; diff --git a/usr.bin/vi/cl/cl_main.c b/usr.bin/vi/cl/cl_main.c index 1a404cbf7df..20aba143893 100644 --- a/usr.bin/vi/cl/cl_main.c +++ b/usr.bin/vi/cl/cl_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_main.c,v 1.22 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: cl_main.c,v 1.23 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -288,12 +288,9 @@ sig_init(GS *gp, SCR *sp) sigaddset(&__sigblockset, SIGINT) || setsig(SIGINT, &clp->oact[INDX_INT], h_int) || sigaddset(&__sigblockset, SIGTERM) || - setsig(SIGTERM, &clp->oact[INDX_TERM], h_term) -#ifdef SIGWINCH - || + setsig(SIGTERM, &clp->oact[INDX_TERM], h_term) || sigaddset(&__sigblockset, SIGWINCH) || setsig(SIGWINCH, &clp->oact[INDX_WINCH], h_winch) -#endif ) { perr(gp->progname, NULL); return (1); @@ -301,11 +298,8 @@ sig_init(GS *gp, SCR *sp) } else if (setsig(SIGHUP, NULL, h_hup) || setsig(SIGINT, NULL, h_int) || - setsig(SIGTERM, NULL, h_term) -#ifdef SIGWINCH - || + setsig(SIGTERM, NULL, h_term) || setsig(SIGWINCH, NULL, h_winch) -#endif ) { msgq(sp, M_SYSERR, "signal-reset"); } @@ -356,9 +350,7 @@ sig_end(GS *gp) (void)sigaction(SIGHUP, NULL, &clp->oact[INDX_HUP]); (void)sigaction(SIGINT, NULL, &clp->oact[INDX_INT]); (void)sigaction(SIGTERM, NULL, &clp->oact[INDX_TERM]); -#ifdef SIGWINCH (void)sigaction(SIGWINCH, NULL, &clp->oact[INDX_WINCH]); -#endif } /* diff --git a/usr.bin/vi/cl/cl_screen.c b/usr.bin/vi/cl/cl_screen.c index 59d7f4c0c08..f5ee598fe59 100644 --- a/usr.bin/vi/cl/cl_screen.c +++ b/usr.bin/vi/cl/cl_screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_screen.c,v 1.21 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: cl_screen.c,v 1.22 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -333,9 +333,7 @@ cl_vi_init(SCR *sp) clp->vi_enter.c_iflag |= IXOFF; clp->vi_enter.c_lflag |= ISIG; -#ifdef VDSUSP clp->vi_enter.c_cc[VDSUSP] = _POSIX_VDISABLE; -#endif clp->vi_enter.c_cc[VQUIT] = _POSIX_VDISABLE; clp->vi_enter.c_cc[VSUSP] = _POSIX_VDISABLE; @@ -345,15 +343,9 @@ cl_vi_init(SCR *sp) * characters when curses switches into raw mode. It should be OK * to do it explicitly for everyone. */ -#ifdef VDISCARD clp->vi_enter.c_cc[VDISCARD] = _POSIX_VDISABLE; -#endif -#ifdef VLNEXT clp->vi_enter.c_cc[VLNEXT] = _POSIX_VDISABLE; -#endif -#ifdef VSTATUS clp->vi_enter.c_cc[VSTATUS] = _POSIX_VDISABLE; -#endif /* Initialize terminal based information. */ if (cl_term_init(sp)) @@ -465,18 +457,10 @@ cl_ex_init(SCR *sp) * to make all ex printf's output \r\n instead of \n. */ clp->ex_enter = clp->orig; - clp->ex_enter.c_lflag |= ECHO | ECHOE | ECHOK | ICANON | IEXTEN | ISIG; -#ifdef ECHOCTL - clp->ex_enter.c_lflag |= ECHOCTL; -#endif -#ifdef ECHOKE - clp->ex_enter.c_lflag |= ECHOKE; -#endif + clp->ex_enter.c_lflag |= + ECHO | ECHOCTL | ECHOE | ECHOK | ECHOKE | ICANON | IEXTEN | ISIG; clp->ex_enter.c_iflag |= ICRNL; - clp->ex_enter.c_oflag |= OPOST; -#ifdef ONLCR - clp->ex_enter.c_oflag |= ONLCR; -#endif + clp->ex_enter.c_oflag |= ONLCR | OPOST; fast: if (tcsetattr(STDIN_FILENO, TCSADRAIN | TCSASOFT, &clp->ex_enter)) { if (errno == EINTR) diff --git a/usr.bin/vi/cl/cl_term.c b/usr.bin/vi/cl/cl_term.c index 40c46368bd4..8c194373d75 100644 --- a/usr.bin/vi/cl/cl_term.c +++ b/usr.bin/vi/cl/cl_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_term.c,v 1.18 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: cl_term.c,v 1.19 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -315,9 +315,7 @@ cl_omesg(SCR *sp, CL_PRIVATE *clp, int on) int cl_ssize(SCR *sp, int sigwinch, size_t *rowp, size_t *colp, int *changedp) { -#ifdef TIOCGWINSZ struct winsize win; -#endif size_t col, row; int rval; char *p; @@ -338,12 +336,10 @@ cl_ssize(SCR *sp, int sigwinch, size_t *rowp, size_t *colp, int *changedp) * Try TIOCGWINSZ. */ row = col = 0; -#ifdef TIOCGWINSZ if (ioctl(STDERR_FILENO, TIOCGWINSZ, &win) != -1) { row = win.ws_row; col = win.ws_col; } -#endif /* If here because of suspend or a signal, only trust TIOCGWINSZ. */ if (sigwinch) { /* diff --git a/usr.bin/vi/common/common.h b/usr.bin/vi/common/common.h index b1dbf0d1337..66b4d1f8864 100644 --- a/usr.bin/vi/common/common.h +++ b/usr.bin/vi/common/common.h @@ -1,4 +1,4 @@ -/* $OpenBSD: common.h,v 1.6 2014/11/06 11:35:02 bentley Exp $ */ +/* $OpenBSD: common.h,v 1.7 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -11,12 +11,6 @@ * @(#)common.h 10.13 (Berkeley) 9/25/96 */ -/* - * Porting information built at configuration time. Included before - * any of nvi's include files. - */ -#include "port.h" - #include <db.h> #include <regex.h> diff --git a/usr.bin/vi/common/exf.c b/usr.bin/vi/common/exf.c index 5576c3a8418..8fb63d4b94e 100644 --- a/usr.bin/vi/common/exf.c +++ b/usr.bin/vi/common/exf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exf.c,v 1.30 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: exf.c,v 1.31 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -12,7 +12,6 @@ #include "config.h" #include <sys/param.h> -#include <sys/types.h> /* XXX: param.h may not have included types.h */ #include <sys/queue.h> #include <sys/stat.h> @@ -1418,11 +1417,9 @@ file_lock(SCR *sp, char *name, int *fdp, int fd, int iswrite) * they are the former. There's no portable way to do this. */ errno = 0; - return (flock(fd, LOCK_EX | LOCK_NB) ? errno == EAGAIN -#ifdef EWOULDBLOCK - || errno == EWOULDBLOCK -#endif - ? LOCK_UNAVAIL : LOCK_FAILED : LOCK_SUCCESS); + return (flock(fd, LOCK_EX | LOCK_NB) ? + errno == EAGAIN || errno == EWOULDBLOCK ? LOCK_UNAVAIL : LOCK_FAILED : + LOCK_SUCCESS); #endif #ifdef HAVE_LOCK_FCNTL /* Gag me. We've got fcntl(2). */ { @@ -1465,11 +1462,8 @@ file_lock(SCR *sp, char *name, int *fdp, int fd, int iswrite) * as returning EACCESS and EAGAIN; add EWOULDBLOCK for good measure, * and assume they are the former. There's no portable way to do this. */ - return (errno == EACCES || errno == EAGAIN -#ifdef EWOULDBLOCK - || errno == EWOULDBLOCK -#endif - ? LOCK_UNAVAIL : LOCK_FAILED); + return (errno == EACCES || errno == EAGAIN || errno == EWOULDBLOCK ? + LOCK_UNAVAIL : LOCK_FAILED); } #endif #if !defined(HAVE_LOCK_FLOCK) && !defined(HAVE_LOCK_FCNTL) diff --git a/usr.bin/vi/common/msg.c b/usr.bin/vi/common/msg.c index 834dd293fd4..8ea5b983307 100644 --- a/usr.bin/vi/common/msg.c +++ b/usr.bin/vi/common/msg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msg.c,v 1.20 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: msg.c,v 1.21 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -12,7 +12,6 @@ #include "config.h" #include <sys/param.h> -#include <sys/types.h> /* XXX: param.h may not have included types.h */ #include <sys/queue.h> #include <sys/stat.h> #include <sys/time.h> @@ -40,27 +39,11 @@ void msgq(SCR *sp, mtype_t mt, const char *fmt, ...) { -#ifndef NL_ARGMAX -#define __NL_ARGMAX 20 /* Set to 9 by System V. */ - struct { - const char *str; /* String pointer. */ - size_t arg; /* Argument number. */ - size_t prefix; /* Prefix string length. */ - size_t skip; /* Skipped string length. */ - size_t suffix; /* Suffix string length. */ - } str[__NL_ARGMAX]; -#endif static int reenter; /* STATIC: Re-entrancy check. */ GS *gp; size_t blen, len, mlen, nlen; const char *p; char *bp, *mp; -#ifndef NL_ARGMAX - size_t cnt1, cnt2, soff; - CHAR_T ch; - const char *t, *u; - char *rbp, *s_rbp; -#endif va_list ap; /* @@ -166,105 +149,6 @@ retry: FREE_SPACE(sp, bp, blen); } fmt = msg_cat(sp, fmt, NULL); -#ifndef NL_ARGMAX - /* - * Nvi should run on machines that don't support the numbered argument - * specifications (%[digit]*$). We do this by reformatting the string - * so that we can hand it to vsnprintf(3) and it will use the arguments - * in the right order. When vsnprintf returns, we put the string back - * into the right order. It's undefined, according to SVID III, to mix - * numbered argument specifications with the standard style arguments, - * so this should be safe. - * - * In addition, we also need a character that is known to not occur in - * any vi message, for separating the parts of the string. As callers - * of msgq are responsible for making sure that all the non-printable - * characters are formatted for printing before calling msgq, we use a - * random non-printable character selected at terminal initialization - * time. This code isn't fast by any means, but as messages should be - * relatively short and normally have only a few arguments, it won't be - * too bad. Regardless, nobody has come up with any other solution. - * - * The result of this loop is an array of pointers into the message - * string, with associated lengths and argument numbers. The array - * is in the "correct" order, and the arg field contains the argument - * order. - */ - for (p = fmt, soff = 0; soff < __NL_ARGMAX;) { - for (t = p; *p != '\0' && *p != '%'; ++p); - if (*p == '\0') - break; - ++p; - if (!isdigit(*p)) { - if (*p == '%') - ++p; - continue; - } - for (u = p; isdigit(*++p);); - if (*p != '$') - continue; - - /* Up to, and including the % character. */ - str[soff].str = t; - str[soff].prefix = u - t; - - /* Up to, and including the $ character. */ - str[soff].arg = atoi(u); - str[soff].skip = (p - u) + 1; - if (str[soff].arg >= __NL_ARGMAX) - goto ret; - - /* Up to, and including the conversion character. */ - for (u = p; (ch = *++p) != '\0';) - if (isalpha(ch) && - strchr("diouxXfeEgGcspn", ch) != NULL) - break; - str[soff].suffix = p - u; - if (ch != '\0') - ++p; - ++soff; - } - - /* If no magic strings, we're done. */ - if (soff == 0) - goto format; - - /* Get space for the reordered strings. */ - if ((rbp = malloc(nlen)) == NULL) - goto ret; - s_rbp = rbp; - - /* - * Reorder the strings into the message string based on argument - * order. - * - * !!! - * We ignore arguments that are out of order, i.e. if we don't find - * an argument, we continue. Assume (almost certainly incorrectly) - * that whoever created the string knew what they were doing. - * - * !!! - * Brute force "sort", but since we don't expect more than one or two - * arguments in a string, the setup cost of a fast sort will be more - * expensive than the loop. - */ - for (cnt1 = 1; cnt1 <= soff; ++cnt1) - for (cnt2 = 0; cnt2 < soff; ++cnt2) - if (cnt1 == str[cnt2].arg) { - memmove(s_rbp, str[cnt2].str, str[cnt2].prefix); - memmove(s_rbp + str[cnt2].prefix, - str[cnt2].str + str[cnt2].prefix + - str[cnt2].skip, str[cnt2].suffix); - s_rbp += str[cnt2].prefix + str[cnt2].suffix; - *s_rbp++ = - gp == NULL ? DEFAULT_NOPRINT : gp->noprint; - break; - } - *s_rbp = '\0'; - fmt = rbp; - -format: -#endif /* Format the arguments into the string. */ va_start(ap, fmt); len = vsnprintf(mp, REM, fmt, ap); @@ -272,46 +156,6 @@ format: if (len >= nlen) goto retry; -#ifndef NL_ARGMAX - if (soff == 0) - goto nofmt; - - /* - * Go through the resulting string, and, for each separator character - * separated string, enter its new starting position and length in the - * array. - */ - for (p = t = mp, cnt1 = 1, - ch = gp == NULL ? DEFAULT_NOPRINT : gp->noprint; *p != '\0'; ++p) - if (*p == ch) { - for (cnt2 = 0; cnt2 < soff; ++cnt2) - if (str[cnt2].arg == cnt1) - break; - str[cnt2].str = t; - str[cnt2].prefix = p - t; - t = p + 1; - ++cnt1; - } - - /* - * Reorder the strings once again, putting them back into the - * message buffer. - * - * !!! - * Note, the length of the message gets decremented once for - * each substring, when we discard the separator character. - */ - for (s_rbp = rbp, cnt1 = 0; cnt1 < soff; ++cnt1) { - memmove(rbp, str[cnt1].str, str[cnt1].prefix); - rbp += str[cnt1].prefix; - --len; - } - memmove(mp, s_rbp, rbp - s_rbp); - - /* Free the reordered string memory. */ - free(s_rbp); -#endif - nofmt: mp += len; if ((mlen += len) > blen) goto retry; diff --git a/usr.bin/vi/common/recover.c b/usr.bin/vi/common/recover.c index 3f935eb290c..712de8a3f89 100644 --- a/usr.bin/vi/common/recover.c +++ b/usr.bin/vi/common/recover.c @@ -1,4 +1,4 @@ -/* $OpenBSD: recover.c,v 1.17 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: recover.c,v 1.18 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -12,7 +12,6 @@ #include "config.h" #include <sys/param.h> -#include <sys/types.h> /* XXX: param.h may not have included types.h */ #include <sys/queue.h> #include <sys/stat.h> diff --git a/usr.bin/vi/ex/ex_argv.c b/usr.bin/vi/ex/ex_argv.c index cbd6bdc36ca..a882d3362dd 100644 --- a/usr.bin/vi/ex/ex_argv.c +++ b/usr.bin/vi/ex/ex_argv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_argv.c,v 1.15 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: ex_argv.c,v 1.16 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -488,7 +488,7 @@ argv_lexp(SCR *sp, EXCMD *excp, char *path) DIR *dirp; EX_PRIVATE *exp; int off; - size_t dlen, len, nlen; + size_t dlen, nlen; char *dname, *name, *p; exp = EXP(sp); @@ -511,11 +511,6 @@ argv_lexp(SCR *sp, EXCMD *excp, char *path) } nlen = strlen(name); - /* - * XXX - * We don't use the d_namlen field, it's not portable enough; we - * assume that d_name is nul terminated, instead. - */ if ((dirp = opendir(dname)) == NULL) { msgq_str(sp, M_SYSERR, dname, "%s"); return (1); @@ -524,15 +519,14 @@ argv_lexp(SCR *sp, EXCMD *excp, char *path) if (nlen == 0) { if (dp->d_name[0] == '.') continue; - len = strlen(dp->d_name); } else { - len = strlen(dp->d_name); - if (len < nlen || memcmp(dp->d_name, name, nlen)) + if (dp->d_namlen < nlen || + memcmp(dp->d_name, name, nlen)) continue; } /* Directory + name + slash + null. */ - argv_alloc(sp, dlen + len + 2); + argv_alloc(sp, dlen + dp->d_namlen + 2); p = exp->args[exp->argsoff]->bp; if (dlen != 0) { memcpy(p, dname, dlen); @@ -540,8 +534,8 @@ argv_lexp(SCR *sp, EXCMD *excp, char *path) if (dlen > 1 || dname[0] != '/') *p++ = '/'; } - memcpy(p, dp->d_name, len + 1); - exp->args[exp->argsoff]->len = dlen + len + 1; + memcpy(p, dp->d_name, dp->d_namlen + 1); + exp->args[exp->argsoff]->len = dlen + dp->d_namlen + 1; ++exp->argsoff; excp->argv = exp->args; excp->argc = exp->argsoff; diff --git a/usr.bin/vi/ex/ex_cscope.c b/usr.bin/vi/ex/ex_cscope.c index 03b38a9a4ff..bb9f2546b8e 100644 --- a/usr.bin/vi/ex/ex_cscope.c +++ b/usr.bin/vi/ex/ex_cscope.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_cscope.c,v 1.21 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: ex_cscope.c,v 1.22 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1994, 1996 @@ -12,7 +12,6 @@ #include "config.h" #include <sys/param.h> -#include <sys/types.h> /* XXX: param.h may not have included types.h */ #include <sys/queue.h> #include <sys/stat.h> #include <sys/time.h> diff --git a/usr.bin/vi/ex/ex_init.c b/usr.bin/vi/ex/ex_init.c index 0a07e49474c..f850b118cc7 100644 --- a/usr.bin/vi/ex/ex_init.c +++ b/usr.bin/vi/ex/ex_init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_init.c,v 1.12 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: ex_init.c,v 1.13 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -12,7 +12,6 @@ #include "config.h" #include <sys/param.h> -#include <sys/types.h> /* XXX: param.h may not have included types.h */ #include <sys/queue.h> #include <sys/stat.h> diff --git a/usr.bin/vi/ex/ex_script.c b/usr.bin/vi/ex/ex_script.c index 21ff361f3f4..67f0c5455b6 100644 --- a/usr.bin/vi/ex/ex_script.c +++ b/usr.bin/vi/ex/ex_script.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_script.c,v 1.20 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: ex_script.c,v 1.21 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -145,15 +145,12 @@ err: if (sc->sh_master != -1) _exit(126); (void)setsid(); -#ifdef TIOCSCTTY /* * 4.4BSD allocates a controlling terminal using the TIOCSCTTY * ioctl, not by opening a terminal device file. POSIX 1003.1 - * doesn't define a portable way to do this. If TIOCSCTTY is - * not available, hope that the open does it. + * doesn't define a portable way to do this. */ (void)ioctl(sc->sh_slave, TIOCSCTTY, 0); -#endif (void)close(sc->sh_master); (void)dup2(sc->sh_slave, STDIN_FILENO); (void)dup2(sc->sh_slave, STDOUT_FILENO); diff --git a/usr.bin/vi/ex/ex_tag.c b/usr.bin/vi/ex/ex_tag.c index c7938b97d30..ae3f8ab69a5 100644 --- a/usr.bin/vi/ex/ex_tag.c +++ b/usr.bin/vi/ex/ex_tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_tag.c,v 1.19 2014/11/12 04:28:41 bentley Exp $ */ +/* $OpenBSD: ex_tag.c,v 1.20 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -15,7 +15,6 @@ #include "config.h" #include <sys/param.h> -#include <sys/types.h> /* XXX: param.h may not have included types.h */ #include <sys/mman.h> #include <sys/queue.h> #include <sys/stat.h> @@ -1008,14 +1007,6 @@ ctag_sfile(SCR *sp, TAGF *tfp, TAGQ *tqp, char *tname) /* * XXX - * Some old BSD systems require MAP_FILE as an argument when mapping - * regular files. - */ -#ifndef MAP_FILE -#define MAP_FILE 0 -#endif - /* - * XXX * We'd like to test if the file is too big to mmap. Since we don't * know what size or type off_t's or size_t's are, what the largest * unsigned integral type is, or what random insanity the local C @@ -1024,7 +1015,7 @@ ctag_sfile(SCR *sp, TAGF *tfp, TAGQ *tqp, char *tname) */ if (fstat(fd, &sb) != 0 || (map = mmap(NULL, (size_t)sb.st_size, PROT_READ | PROT_WRITE, - MAP_FILE | MAP_PRIVATE, fd, (off_t)0)) == MAP_FAILED) { + MAP_PRIVATE, fd, (off_t)0)) == MAP_FAILED) { tfp->errnum = errno; (void)close(fd); return (1); diff --git a/usr.bin/vi/ex/script.h b/usr.bin/vi/ex/script.h index 0db8fc40211..3f6b284efdd 100644 --- a/usr.bin/vi/ex/script.h +++ b/usr.bin/vi/ex/script.h @@ -1,4 +1,4 @@ -/* $OpenBSD: script.h,v 1.3 2001/01/29 01:58:46 niklas Exp $ */ +/* $OpenBSD: script.h,v 1.4 2014/11/12 16:29:04 millert Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -18,8 +18,6 @@ struct _script { char *sh_prompt; /* Prompt. */ size_t sh_prompt_len; /* Prompt length. */ char sh_name[64]; /* Pty name */ -#ifdef TIOCGWINSZ struct winsize sh_win; /* Window size. */ -#endif struct termios sh_term; /* Terminal information. */ }; |