From owner-svn-src-all@FreeBSD.ORG Wed May 29 22:37:21 2013 Return-Path: Delivered-To: svn-src-all@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 4FEA8F44; Wed, 29 May 2013 22:37:21 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ie0-x236.google.com (mail-ie0-x236.google.com [IPv6:2607:f8b0:4001:c03::236]) by mx1.freebsd.org (Postfix) with ESMTP id 0647DD18; Wed, 29 May 2013 22:37:20 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id a14so26308677iee.41 for ; Wed, 29 May 2013 15:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=b9lMYYUcLvAD2UkGZjhWMpzx3vsd3m5NywEoY6Rs89A=; b=rQ2jInAvQP+4IqMy5xCWzWPNKBMR/QThHZ0fswaM4Js0ddg+ur3sUBoHAHDF1YEdAY pzr1LkoVFMZVeVcYnURWvHPUcE1u7EmkgQaGjGtO0sXUuMpfEJu3P+t4JVbBDOBjCH+V x7aiuv6bltSyeCcB3R/ChuYsDFxVfBUHg8qg/29eN/GLUAAeP1SzFqWY1dF2QI/x4vNP 3eN/bKsUyNtmYq7hVkCHBMpK5ryjoBjPZxW1qEk3xr92Z1y5vPXP4I93Pnr3s9J51Bbl nVtEwqkrYWBD3D8VyvV/Q6Mc9qBcI4wPCKtHqpNl0ksFD1Oe+p0hTKwuF9HkjlVtPgB8 aXvA== X-Received: by 10.50.128.134 with SMTP id no6mr10570885igb.10.1369867040763; Wed, 29 May 2013 15:37:20 -0700 (PDT) Received: from raichu (24-212-218-13.cable.teksavvy.com. [24.212.218.13]) by mx.google.com with ESMTPSA id y11sm11417508igy.10.2013.05.29.15.37.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 15:37:20 -0700 (PDT) Sender: Mark Johnston Date: Wed, 29 May 2013 18:37:17 -0400 From: Mark Johnston To: src-committers@freebsd.org Subject: Re: svn commit: r251113 - stable/9/usr.sbin/newsyslog Message-ID: <20130529223717.GB59966@raichu> References: <201305292230.r4TMUUPX079884@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305292230.r4TMUUPX079884@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 22:37:21 -0000 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? Sorry again, -Mark 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 > > 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 when I > did the MFC, even after I tested. > > Modified: > stable/9/usr.sbin/newsyslog/newsyslog.c > Directory Properties: > stable/9/usr.sbin/newsyslog/ (props changed) > > Modified: stable/9/usr.sbin/newsyslog/newsyslog.c > ============================================================================== > --- stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:29:33 2013 (r251112) > +++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:30:29 2013 (r251113) > @@ -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 *logfname, > - struct tm *tm) > +validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) > { > - struct stat sb; > size_t logfname_len; > char *s; > int c; > > logfname_len = strlen(logfname); > > - if (dp->d_type != 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 != DT_UNKNOWN || > - fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || > - !S_ISREG(sb.st_mode)) > - return (0); > - } > + if (dp->d_type != DT_REG) > + return (0); > /* Ignore everything but files with our logfile prefix. */ > if (strncmp(dp->d_name, logfname, logfname_len) != 0) > return (0); > @@ -1556,7 +1545,7 @@ delete_oldest_timelog(const struct conf_ > err(1, "Cannot open log directory '%s'", dir); > dirfd = dirfd(dirp); > while ((dp = readdir(dirp)) != NULL) { > - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) > + if (validate_old_timelog(dp, logfname, &tm) == 0) > continue; > > /* > @@ -2321,10 +2310,10 @@ mtime_old_timelog(const char *file) > dir_fd = dirfd(dirp); > /* Open the archive dir and find the most recent archive of logfname. */ > while ((dp = readdir(dirp)) != NULL) { > - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) > + if (validate_old_timelog(dp, logfname, &tm) == 0) > continue; > > - if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { > + if (fstatat(dir_fd, logfname, &sb, 0) == -1) { > warn("Cannot stat '%s'", file); > continue; > }