From owner-svn-src-head@freebsd.org Thu Nov 24 15:27:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EDCAC5385D; Thu, 24 Nov 2016 15:27:54 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C8F7C14; Thu, 24 Nov 2016 15:27:54 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yw0-x22c.google.com with SMTP id i145so41834870ywg.2; Thu, 24 Nov 2016 07:27:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=v0G57otIuNcez8rAn4eC+/MOW+uDYQkx4NtxzeIZjAc=; b=FPOA8zeLYLaN1WQUg++VCUfdn8PNvA8u0tLXNtmLZ2ugL16l+3L5kej64MxPt0mKd9 TkMia4wU4omBgyu+4KJH+dJoKAQwySRE2lzmaDnUZDSTaT6Y9tztN08BFxN4RxPKnxcN sFYtdmmDXslctXV05kQKmhlCZexRBK60n9eNpg5OZrp6xPQV1iqZTFucUlGe9GcvVtT8 Z6wwsIaTTI3YWdPqV7zZ9l3sP8iJoXZfeg6xoQnP+uclXatpGQ2gI0UIbJdAgD/GDQSP p8c2SXjJfiCDE8CbxaxynufeobSY5FWLKH8nF5FtfRP3bzkWd9JwvBluIw9uhysfh0bS S5rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=v0G57otIuNcez8rAn4eC+/MOW+uDYQkx4NtxzeIZjAc=; b=QA5prepVjqyT6H6jRFObqwUiZXq+Iq1yIj+sBs4nwMnZhfMLWEbE+soE4w/aG/bb9w 7nyJYwehup2rWzFaTTC2QCSIECBdgicd0ZGnkSom83ERULw1VL26WLvTzAjalm/0z7zz ccoaUwhSmC/RmrdEjrpDar3sKMEL7TEOCErFX2iO+MmRUkl/mZyjfM8IaqUrSZEnQbXZ ZCtXsFYOzKJlEbY8viwJVV9d+3UM9fjoC700m1lJMoeYmNhHbmoMuqrpdfRW2P7ACAXn bVXrm5agNFlKHh5iMVlGPwjZIDtaiViocqH9L2ywiFrFF9mI3csfHiib9cLLdnfokTGY zOSw== X-Gm-Message-State: AKaTC02Fm+SE+TPISLeTWJu1ldeK9yGpR2lx6r8MoojjWAjBgCaznODIOUz8d2TiScXuwtvD3JRdkwh80siWxQ== X-Received: by 10.13.237.67 with SMTP id w64mr4040833ywe.167.1480001273379; Thu, 24 Nov 2016 07:27:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.163.194 with HTTP; Thu, 24 Nov 2016 07:27:52 -0800 (PST) Received: by 10.129.163.194 with HTTP; Thu, 24 Nov 2016 07:27:52 -0800 (PST) Reply-To: araujo@freebsd.org In-Reply-To: <201611241450.uAOEoLA5079215@repo.freebsd.org> References: <201611241450.uAOEoLA5079215@repo.freebsd.org> From: Marcelo Araujo Date: Thu, 24 Nov 2016 23:27:52 +0800 Message-ID: Subject: Re: svn commit: r309109 - head/lib/libutil To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2016 15:27:54 -0000 On Nov 24, 2016 10:50 PM, "Dag-Erling Sm=C3=B8rgrav" wrot= e: > > Author: des > Date: Thu Nov 24 14:50:21 2016 > New Revision: 309109 > URL: https://svnweb.freebsd.org/changeset/base/309109 > > Log: > Add a warning against modifying this code without understanding it, and > an example of how not to make it more portable. I've had this lying > around uncommitted since 2009... > > Modified: > head/lib/libutil/flopen.c > > Modified: head/lib/libutil/flopen.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libutil/flopen.c Thu Nov 24 14:48:46 2016 (r309108) > +++ head/lib/libutil/flopen.c Thu Nov 24 14:50:21 2016 (r309109) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2007 Dag-Erling Co=C3=AFdan Sm=C3=B8rgrav > + * Copyright (c) 2007-2009 Dag-Erling Co=C3=AFdan Sm=C3=B8rgrav > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -37,6 +37,14 @@ __FBSDID("$FreeBSD$"); > > #include > > +/* > + * Reliably open and lock a file. > + * > + * DO NOT, UNDER PAIN OF DEATH, modify this code without first reading the > + * revision history and discussing your changes with . > + * Don't be fooled by the code's apparent simplicity; there would be no > + * need for this function if it was as easy to get right as you think. > + */ > int > flopen(const char *path, int flags, ...) > { > @@ -100,6 +108,14 @@ flopen(const char *path, int flags, ...) > errno =3D serrno; > return (-1); > } > +#ifdef DONT_EVEN_THINK_ABOUT_IT > + if (fcntl(fd, F_SETFD, FD_CLOEXEC) !=3D 0) { > + serrno =3D errno; > + (void)close(fd); > + errno =3D serrno; > + return (-1); > + } > +#endif > return (fd); > } > } > Serious? We have code review, we have some many ways for communication, even revert a commit if needed. That is not how open source works, sad to say that for you twice this year. Please revert it, it is bad for the community and for FreeBSD. Everybody can read the svn history. Best,