From owner-svn-src-all@freebsd.org Mon May 16 06:30:44 2016 Return-Path: Delivered-To: svn-src-all@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 BF030B3D34C; Mon, 16 May 2016 06:30:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (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 87C0B169E; Mon, 16 May 2016 06:30:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x22b.google.com with SMTP id f89so198480787ioi.0; Sun, 15 May 2016 23:30:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=zZeJAe3UrADNb6ZaIfnJLHcQ4BfZfF38KRT0mye1rro=; b=y9k66Vn5yneANCojSJ30JCBEqiYz4+j2F+F8xJHba7YIPnqVJN7McCbaHwzjAGGTOL T9i/H+MgaHT+p1DneIknJYpwUdtfI7N+REAFrm+hBrCCCc2+PJC3BTJPUKi7VdiW0vfc 6dNELP4M49T8NYQZEip/jh9glCRGfXksUfzgkF7r1szhvDaOgQOk6rX5Rw4XOpdTgSgU Rhk4Esu5rz53y9lQWMPp09cDD+dxMLdhmcZ/5nA/nPoAYQb4co61cXJUHDWrJreb/iXa 4z89/mZg2ULPBBFX8UvnaRcAAU0h5WHPO9QL/t1k+io/6j5d2o7Q5hsBYNtCSvBW2Twf sOfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=zZeJAe3UrADNb6ZaIfnJLHcQ4BfZfF38KRT0mye1rro=; b=cw6zdAr9w64GC8MyGu9c8zMS6VorgVacAt5AjIm1u9g2lLd6JiDIqXeKSH0mieuUrF OeEZ16fEM77hAi9SS/Skt8EoqKnEwVz28bEoxG8/iu8GBF1slUHakvipZzEFrn/Mo1i7 k3GCrruPSzYKwy+OU5Ki5UHKJKZDznrqqpBB2NxgKzI7TpWFzVfmsZxJKiNj756Vu7s7 pjoML8IjN2+9LIauGmCYK7g/siMF+GHcI5GvLnQBkvkVNjKrE6L16fVUfBxyA6wqHLk/ rYTES8u4lK2kRpLzQjYyuI60HKpCXBR5YHsh/CAidrYfxbcwXmj1SgovVF/Qrhbq3iDO qoSg== X-Gm-Message-State: AOPr4FX9PTEuzj+wwmVSjhmjEkPM4eslK36FiV1smFvCWUMjn9RbK60GG4Of7gK1UNSyjQ== X-Received: by 10.107.131.136 with SMTP id n8mr18722374ioi.132.1463380244041; Sun, 15 May 2016 23:30:44 -0700 (PDT) Received: from [192.168.20.14] (c-73-97-222-46.hsd1.wa.comcast.net. [73.97.222.46]) by smtp.gmail.com with ESMTPSA id e101sm10238774iod.29.2016.05.15.23.30.43 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 15 May 2016 23:30:43 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r299850 - in head/usr.bin/xinstall: . tests From: NGie Cooper X-Mailer: iPhone Mail (13E238) In-Reply-To: <201605151317.u4FDH6Ma038967@repo.freebsd.org> Date: Sun, 15 May 2016 23:30:42 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <74BD0EA9-0DE6-4253-8C2A-43B341F1E2F9@gmail.com> References: <201605151317.u4FDH6Ma038967@repo.freebsd.org> To: Jilles Tjoelker X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 16 May 2016 06:30:44 -0000 > On May 15, 2016, at 06:17, Jilles Tjoelker wrote: >=20 > Author: jilles > Date: Sun May 15 13:17:05 2016 > New Revision: 299850 > URL: https://svnweb.freebsd.org/changeset/base/299850 >=20 > Log: > install: When preserving timestamps, also copy the nanoseconds part. >=20 > Modified: > head/usr.bin/xinstall/tests/install_test.sh > head/usr.bin/xinstall/xinstall.c This broke bootstrapping on stable/10, as seen with the recent Jenkins failu= res. > Modified: head/usr.bin/xinstall/tests/install_test.sh > =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/usr.bin/xinstall/tests/install_test.sh Sun May 15 08:36:12 201= 6 (r299849) > +++ head/usr.bin/xinstall/tests/install_test.sh Sun May 15 13:17:05 201= 6 (r299850) > @@ -64,6 +64,12 @@ copy_to_nonexistent_backup_safe_body() { > copy_to_nonexistent_with_opts -b -B.bak -S > } >=20 > +atf_test_case copy_to_nonexistent_preserving > +copy_to_nonexistent_preserving_body() { > + copy_to_nonexistent_with_opts -p > + [ ! testf -ot copyf ] || atf_fail "bad timestamp 2" > +} > + > copy_self_with_opts() { > printf 'test\n123\r456\r\n789\0z' >testf > printf 'test\n123\r456\r\n789\0z' >testf2 > @@ -307,6 +313,7 @@ atf_init_test_cases() { > atf_add_test_case copy_to_nonexistent_safe_comparing > atf_add_test_case copy_to_nonexistent_backup > atf_add_test_case copy_to_nonexistent_backup_safe > + atf_add_test_case copy_to_nonexistent_preserving > atf_add_test_case copy_self > atf_add_test_case copy_self_safe > atf_add_test_case copy_self_comparing >=20 > Modified: head/usr.bin/xinstall/xinstall.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/usr.bin/xinstall/xinstall.c Sun May 15 08:36:12 2016 (r2998= 49) > +++ head/usr.bin/xinstall/xinstall.c Sun May 15 13:17:05 2016 (r2998= 50) > @@ -131,7 +131,7 @@ static void do_symlink(const char *, con > static void makelink(const char *, const char *, const struct stat *); > static void install(const char *, const char *, u_long, u_int); > static void install_dir(char *); > -static void metadata_log(const char *, const char *, struct timeval *,= > +static void metadata_log(const char *, const char *, struct timespec *= , > const char *, const char *, off_t); > static int parseid(const char *, id_t *); > static void strip(const char *); > @@ -722,7 +722,7 @@ static void > install(const char *from_name, const char *to_name, u_long fset, u_int fla= gs) > { > struct stat from_sb, temp_sb, to_sb; > - struct timeval tvb[2]; > + struct timespec tsb[2]; > int devnull, files_match, from_fd, serrno, target; > int tempcopy, temp_fd, to_fd; > char backup[MAXPATHLEN], *p, pathbuf[MAXPATHLEN], tempfile[MAXPATHLEN];= > @@ -857,11 +857,9 @@ install(const char *from_name, const cha > * Need to preserve target file times, though. > */ > if (to_sb.st_nlink !=3D 1) { > - tvb[0].tv_sec =3D to_sb.st_atime; > - tvb[0].tv_usec =3D 0; > - tvb[1].tv_sec =3D to_sb.st_mtime; > - tvb[1].tv_usec =3D 0; > - (void)utimes(tempfile, tvb); > + tsb[0] =3D to_sb.st_atim; > + tsb[1] =3D to_sb.st_mtim; > + (void)utimensat(AT_FDCWD, tempfile, tsb, 0); > } else { > files_match =3D 1; > (void)unlink(tempfile); > @@ -916,11 +914,9 @@ install(const char *from_name, const cha > * Preserve the timestamp of the source file if necessary. > */ > if (dopreserve && !files_match && !devnull) { > - tvb[0].tv_sec =3D from_sb.st_atime; > - tvb[0].tv_usec =3D 0; > - tvb[1].tv_sec =3D from_sb.st_mtime; > - tvb[1].tv_usec =3D 0; > - (void)utimes(to_name, tvb); > + tsb[0] =3D from_sb.st_atim; > + tsb[1] =3D from_sb.st_mtim; > + (void)utimensat(AT_FDCWD, to_name, tsb, 0); > } >=20 > if (fstat(to_fd, &to_sb) =3D=3D -1) { > @@ -989,7 +985,7 @@ install(const char *from_name, const cha > if (!devnull) > (void)close(from_fd); >=20 > - metadata_log(to_name, "file", tvb, NULL, digestresult, to_sb.st_size)= ; > + metadata_log(to_name, "file", tsb, NULL, digestresult, to_sb.st_size)= ; > free(digestresult); > } >=20 > @@ -1301,7 +1297,7 @@ again: > * or to allow integrity checks to be performed. > */ > static void > -metadata_log(const char *path, const char *type, struct timeval *tv, > +metadata_log(const char *path, const char *type, struct timespec *ts, > const char *slink, const char *digestresult, off_t size) > { > static const char extra[] =3D { ' ', '\t', '\n', '\\', '#', '\0' }; > @@ -1355,9 +1351,9 @@ metadata_log(const char *path, const cha > } > if (*type =3D=3D 'f') /* type=3Dfile */ > fprintf(metafp, " size=3D%lld", (long long)size); > - if (tv !=3D NULL && dopreserve) > - fprintf(metafp, " time=3D%lld.%ld", > - (long long)tv[1].tv_sec, (long)tv[1].tv_usec); > + if (ts !=3D NULL && dopreserve) > + fprintf(metafp, " time=3D%lld.%09ld", > + (long long)ts[1].tv_sec, ts[1].tv_nsec); > if (digestresult && digest) > fprintf(metafp, " %s=3D%s", digest, digestresult); > if (fflags) >=20