Cygwin: cygcheck: lower setup.ini expiration time to 3 hours

...as is default for dnf

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2023-01-29 21:32:25 +01:00
parent 37c5b6d929
commit 4b157b44ca
1 changed files with 4 additions and 4 deletions

View File

@ -2126,12 +2126,12 @@ struct passwd {
static FILE * static FILE *
maybe_download_setup_ini () maybe_download_setup_ini ()
{ {
time_t t24h_before; time_t t3h_before;
char *path; char *path;
struct stat st; struct stat st;
FILE *fp; FILE *fp;
t24h_before = time (NULL) - 24 * 60 * 60; t3h_before = time (NULL) - 3 * 60 * 60;
for (int i = 0; i < 2; ++i) for (int i = 0; i < 2; ++i)
{ {
/* Check for the system-wide setup.ini file first. If that's too /* Check for the system-wide setup.ini file first. If that's too
@ -2150,10 +2150,10 @@ maybe_download_setup_ini ()
cp = stpcpy (path, localappdata); cp = stpcpy (path, localappdata);
stpcpy (cp, "\\.setup.ini"); 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. */ and if we can open it for reading, just use it. */
if (stat (path, &st) == 0 if (stat (path, &st) == 0
&& st.st_mtime > t24h_before && st.st_mtime > t3h_before
&& (fp = fopen (path, "rt")) != NULL) && (fp = fopen (path, "rt")) != NULL)
return fp; return fp;
/* Otherwise, try to open it for writing and fetch from cygwin.com. */ /* Otherwise, try to open it for writing and fetch from cygwin.com. */