From owner-freebsd-bugs@FreeBSD.ORG Mon Jan 2 10:30:15 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEF331065675 for ; Mon, 2 Jan 2012 10:30:15 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 514E78FC13 for ; Mon, 2 Jan 2012 10:30:15 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q02AUFwN068081 for ; Mon, 2 Jan 2012 10:30:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q02AUFFU068078; Mon, 2 Jan 2012 10:30:15 GMT (envelope-from gnats) Resent-Date: Mon, 2 Jan 2012 10:30:15 GMT Resent-Message-Id: <201201021030.q02AUFFU068078@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B7881065672 for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/163772: [patch] contrib/nvi - don't mask O_DIRECTORY symbol X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 10:30:15 -0000 >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: