From f1d9bbbb475d137b92beb83eafe3aedda8aadc3a Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sat, 15 Dec 2012 12:24:06 -0500 Subject: [PATCH] Let CACHETIMEOUT work for non-cached files. Rather than return GPG_ERR_NOT_FOUND. A configuration entry for the file is created in the cached config. --- src/commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands.c b/src/commands.c index 5397e983..0615a949 100644 --- a/src/commands.c +++ b/src/commands.c @@ -2211,8 +2211,9 @@ cachetimeout_command (assuan_context_t ctx, char *line) gcry_md_hash_buffer (GCRY_MD_MD5, md5file, req[0], strlen (req[0])); rc = cache_set_timeout (md5file, timeout); - if (!rc) + if (!rc || gpg_err_code (rc) == GPG_ERR_NOT_FOUND) { + rc = 0; MUTEX_LOCK (&rcfile_mutex); config_set_int_param (&global_config, req[0], "cache_timeout", req[1]); MUTEX_UNLOCK (&rcfile_mutex); -- 2.11.4.GIT