From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 7E0AC3858C20; Sun, 29 Jan 2023 20:32:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E0AC3858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675024373; bh=m94sqlQALDLoKxSHk6ua5+s5YLa/Pet1LlaK/ZWz04Q=; h=From:To:Subject:Date:From; b=ymtayD0krNyCm0OrZ+qANcTJtcd3J0Ue6uEtxrBGxA+B+lEQHQ+fcdPeJUlRN9LCB cp/NIpozF2Y3TBd4cFBlyo9ckhiMH+8Gn8WE/XiCyu/D/mo3fLULkcAi611FcxJw2Z gUCe+96DGE/bM5+NC/SlE992bHOlFcicDENacAEI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: cygcheck: lower setup.ini expiration time to 3 hours X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 37c5b6d929bd6acd0f64467ccbd8a298a77ad98a X-Git-Newrev: 4b157b44cad099c375801453dc245da660f0cb85 Message-Id: <20230129203253.7E0AC3858C20@sourceware.org> Date: Sun, 29 Jan 2023 20:32:53 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D4b157b44cad= 099c375801453dc245da660f0cb85 commit 4b157b44cad099c375801453dc245da660f0cb85 Author: Corinna Vinschen AuthorDate: Sun Jan 29 21:32:25 2023 +0100 Commit: Corinna Vinschen CommitDate: Sun Jan 29 21:32:25 2023 +0100 Cygwin: cygcheck: lower setup.ini expiration time to 3 hours =20 ...as is default for dnf =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/utils/mingw/cygcheck.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/winsup/utils/mingw/cygcheck.cc b/winsup/utils/mingw/cygcheck.cc index 777347371612..7ac19afe5d2f 100644 --- a/winsup/utils/mingw/cygcheck.cc +++ b/winsup/utils/mingw/cygcheck.cc @@ -2126,12 +2126,12 @@ struct passwd { static FILE * maybe_download_setup_ini () { - time_t t24h_before; + time_t t3h_before; char *path; struct stat st; FILE *fp; =20 - t24h_before =3D time (NULL) - 24 * 60 * 60; + t3h_before =3D time (NULL) - 3 * 60 * 60; for (int i =3D 0; i < 2; ++i) { /* Check for the system-wide setup.ini file first. If that's too @@ -2150,10 +2150,10 @@ maybe_download_setup_ini () cp =3D stpcpy (path, localappdata); stpcpy (cp, "\\.setup.ini"); } - /* If file exists, and has been downloaded less than 24h ago, + /* If file exists, and has been downloaded less than 3h ago, and if we can open it for reading, just use it. */ if (stat (path, &st) =3D=3D 0 - && st.st_mtime > t24h_before + && st.st_mtime > t3h_before && (fp =3D fopen (path, "rt")) !=3D NULL) return fp; /* Otherwise, try to open it for writing and fetch from cygwin.com. = */