From nobody@FreeBSD.org  Mon Jan  2 10:27:43 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B7881065672
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  2 Jan 2012 10:27:43 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 308318FC19
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  2 Jan 2012 10:27:43 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q02ARgb1094398
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 2 Jan 2012 10:27:42 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q02ARgMs094397;
	Mon, 2 Jan 2012 10:27:42 GMT
	(envelope-from nobody)
Message-Id: <201201021027.q02ARgMs094397@red.freebsd.org>
Date: Mon, 2 Jan 2012 10:27:42 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] contrib/nvi - don't mask O_DIRECTORY symbol
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         163772
>Category:       bin
>Synopsis:       [patch] nvi(1) - don't mask O_DIRECTORY symbol
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 02 10:30:14 UTC 2012
>Closed-Date:    Mon Mar 05 00:26:26 UTC 2012
>Last-Modified:  Sun Feb 03 22:29:59 UTC 2013
>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:
State-Changed-From-To: open->closed 
State-Changed-By: eadler 
State-Changed-When: Mon Mar 5 00:26:25 UTC 2012 
State-Changed-Why:  
contributed software patches should be sent upstream 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163772 
>Unformatted:
