From owner-svn-src-stable-9@FreeBSD.ORG Thu May 30 00:55:35 2013 Return-Path: Delivered-To: svn-src-stable-9@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 97E7DE7B; Thu, 30 May 2013 00:55:35 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 88EA2757; Thu, 30 May 2013 00:55:28 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4U0tRFD029076; Wed, 29 May 2013 19:55:27 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4U0tRKo029075; Wed, 29 May 2013 19:55:27 -0500 (CDT) (envelope-from brooks) Date: Wed, 29 May 2013 19:55:27 -0500 From: Brooks Davis To: Mark Johnston Subject: Re: svn commit: r251113 - stable/9/usr.sbin/newsyslog Message-ID: <20130530005527.GA29026@lor.one-eyed-alien.net> References: <201305292230.r4TMUUPX079884@svn.freebsd.org> <20130529223717.GB59966@raichu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: <20130529223717.GB59966@raichu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 00:55:35 -0000 --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 29, 2013 at 06:37:17PM -0400, Mark Johnston wrote: > I'm very sorry about this. I was going to merge r235647 first so that I > wouldn't make the same mistake a second time, but I decided against it > when I saw that the commit extended beyond newsyslog, and then managed > to do the MFC incorrectly after verifying that newsyslog built on the > stable branches. Is it possible to only do the newsyslog portion of this > MFC, or is it a rule that either all or none of a given revision should > be merged to the stable branches? The approved way to merge a change like r235647 would be per-library and per-program so only merging changes to a single program would be fine. -- Brooks >=20 > Sorry again, > -Mark >=20 > On Wed, May 29, 2013 at 10:30:30PM +0000, Mark Johnston wrote: > > Author: markj > > Date: Wed May 29 22:30:29 2013 > > New Revision: 251113 > > URL: http://svnweb.freebsd.org/changeset/base/251113 > >=20 > > Log: > > Revert my previous merge. There's a variable name difference between = head > > and stable (dirfd vs. dir_fd) and I managed to get it wrong again whe= n I > > did the MFC, even after I tested. > >=20 > > Modified: > > stable/9/usr.sbin/newsyslog/newsyslog.c > > Directory Properties: > > stable/9/usr.sbin/newsyslog/ (props changed) > >=20 > > Modified: stable/9/usr.sbin/newsyslog/newsyslog.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 > > --- stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:29:33 2013 (r= 251112) > > +++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:30:29 2013 (r= 251113) > > @@ -1450,27 +1450,16 @@ oldlog_entry_compare(const void *a, cons > > * tm if this is the case; otherwise return false. > > */ > > static int > > -validate_old_timelog(int fd, const struct dirent *dp, const char *logf= name, > > - struct tm *tm) > > +validate_old_timelog(const struct dirent *dp, const char *logfname, st= ruct tm *tm) > > { > > - struct stat sb; > > size_t logfname_len; > > char *s; > > int c; > > =20 > > logfname_len =3D strlen(logfname); > > =20 > > - if (dp->d_type !=3D DT_REG) { > > - /* > > - * Some filesystems (e.g. NFS) don't fill out the d_type field > > - * and leave it set to DT_UNKNOWN; in this case we must obtain > > - * the file type ourselves. > > - */ > > - if (dp->d_type !=3D DT_UNKNOWN || > > - fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) !=3D 0 || > > - !S_ISREG(sb.st_mode)) > > - return (0); > > - } > > + if (dp->d_type !=3D DT_REG) > > + return (0); > > /* Ignore everything but files with our logfile prefix. */ > > if (strncmp(dp->d_name, logfname, logfname_len) !=3D 0) > > return (0); > > @@ -1556,7 +1545,7 @@ delete_oldest_timelog(const struct conf_ > > err(1, "Cannot open log directory '%s'", dir); > > dirfd =3D dirfd(dirp); > > while ((dp =3D readdir(dirp)) !=3D NULL) { > > - if (validate_old_timelog(dir_fd, dp, logfname, &tm) =3D=3D 0) > > + if (validate_old_timelog(dp, logfname, &tm) =3D=3D 0) > > continue; > > =20 > > /* > > @@ -2321,10 +2310,10 @@ mtime_old_timelog(const char *file) > > dir_fd =3D dirfd(dirp); > > /* Open the archive dir and find the most recent archive of logfname.= */ > > while ((dp =3D readdir(dirp)) !=3D NULL) { > > - if (validate_old_timelog(dir_fd, dp, logfname, &tm) =3D=3D 0) > > + if (validate_old_timelog(dp, logfname, &tm) =3D=3D 0) > > continue; > > =20 > > - if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) =3D=3D -1) { > > + if (fstatat(dir_fd, logfname, &sb, 0) =3D=3D -1) { > > warn("Cannot stat '%s'", file); > > continue; > > } >=20 --cWoXeonUoKmBZSoM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRpqN/XY6L6fI4GtQRAlWvAKCfo1o7ShOOvE56C8UJAzCIFtmbYQCZAYsQ Y8wYpxVeZGwlqaKU7QvsqnA= =SDiT -----END PGP SIGNATURE----- --cWoXeonUoKmBZSoM--