Date: Mon, 2 Jan 2012 10:27:42 GMT From: Garrett Cooper <yanegomi@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/163772: [patch] contrib/nvi - don't mask O_DIRECTORY symbol Message-ID: <201201021027.q02ARgMs094397@red.freebsd.org> Resent-Message-ID: <201201021030.q02AUFFU068078@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 163772 >Category: bin >Synopsis: [patch] contrib/nvi - don't mask O_DIRECTORY symbol >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 02 10:30:14 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 9.0-PRERELEASE >Organization: n/a >Environment: FreeBSD bayonetta.local 9.0-PRERELEASE FreeBSD 9.0-PRERELEASE #0 r229187M: Sun Jan 1 14:39:27 PST 2012 gcooper@bayonetta.local:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA amd64 >Description: contrib/nvi masks the fcntl.h symbol: O_DIRECTORY. It's not really a big deal with the standalone app; the concern is that this generates warnings when compiling the crunched version of nvi, which in turn could cause problems depending on how the crunched binary is linked. >How-To-Repeat: >Fix: Patch attached with submission follows: Index: contrib/nvi/include/options_def.h =================================================================== --- contrib/nvi/include/options_def.h (revision 229264) +++ contrib/nvi/include/options_def.h (working copy) @@ -8,7 +8,7 @@ #define O_CEDIT 7 #define O_COLUMNS 8 #define O_COMMENT 9 -#define O_DIRECTORY 10 +#define O_DIR 10 #define O_EDCOMPATIBLE 11 #define O_ESCAPETIME 12 #define O_ERRORBELLS 13 Index: contrib/nvi/common/exf.c =================================================================== --- contrib/nvi/common/exf.c (revision 229264) +++ contrib/nvi/common/exf.c (working copy) @@ -187,10 +187,10 @@ */ oname = frp->name; if (LF_ISSET(FS_OPENERR) || oname == NULL || !exists) { - if (opts_empty(sp, O_DIRECTORY, 0)) + if (opts_empty(sp, O_DIR, 0)) goto err; (void)snprintf(tname, sizeof(tname), - "%s/vi.XXXXXXXXXX", O_STR(sp, O_DIRECTORY)); + "%s/vi.XXXXXXXXXX", O_STR(sp, O_DIR)); if ((fd = mkstemp(tname)) == -1) { msgq(sp, M_SYSERR, "237|Unable to create temporary file"); Index: contrib/nvi/common/options.c =================================================================== --- contrib/nvi/common/options.c (revision 229264) +++ contrib/nvi/common/options.c (working copy) @@ -64,7 +64,7 @@ {"columns", f_columns, OPT_NUM, OPT_NOSAVE}, /* O_COMMENT 4.4BSD */ {"comment", NULL, OPT_0BOOL, 0}, -/* O_DIRECTORY 4BSD */ +/* O_DIR 4BSD */ {"directory", NULL, OPT_STR, 0}, /* O_EDCOMPATIBLE 4BSD */ {"edcompatible",NULL, OPT_0BOOL, 0}, @@ -244,7 +244,7 @@ {"aw", O_AUTOWRITE}, /* 4BSD */ {"bf", O_BEAUTIFY}, /* 4BSD */ {"co", O_COLUMNS}, /* 4.4BSD */ - {"dir", O_DIRECTORY}, /* 4BSD */ + {"dir", O_DIR}, /* 4BSD */ {"eb", O_ERRORBELLS}, /* 4BSD */ {"ed", O_EDCOMPATIBLE}, /* 4BSD */ {"ex", O_EXRC}, /* System V (undocumented) */ @@ -347,7 +347,7 @@ */ (void)snprintf(b1, sizeof(b1), "directory=%s", (s = getenv("TMPDIR")) == NULL ? _PATH_TMP : s); - OI(O_DIRECTORY, b1); + OI(O_DIR, b1); OI(O_ESCAPETIME, "escapetime=6"); OI(O_KEYTIME, "keytime=6"); OI(O_MATCHTIME, "matchtime=7"); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201021027.q02ARgMs094397>