X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fcrypto%2Fserv_crypto.c;fp=citadel%2Fmodules%2Fcrypto%2Fserv_crypto.c;h=302be080e427ec3d00c5e1653daeba6aa89c6674;hb=8e09a2927df885bd83dd6361b6a70242069083ce;hp=98cded3c9f273364f227ffc1bd06ab14cd9e60f8;hpb=9e24fd4e798bd6871d71531015b839d04c0dbd22;p=citadel.git diff --git a/citadel/modules/crypto/serv_crypto.c b/citadel/modules/crypto/serv_crypto.c index 98cded3c9..302be080e 100644 --- a/citadel/modules/crypto/serv_crypto.c +++ b/citadel/modules/crypto/serv_crypto.c @@ -1,4 +1,4 @@ -// Copyright (c) 1987-2021 by the citadel.org team +// Copyright (c) 1987-2022 by the citadel.org team // // This program is open source software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 3. @@ -112,7 +112,7 @@ void bind_to_key_and_certificate(void) { // Check the modification time of the key and certificate -- reload if they changed void update_key_and_cert_if_needed(void) { - static time_t cert_mtime = 0; + static time_t previous_mtime = 0; struct stat keystat; struct stat certstat; @@ -125,9 +125,9 @@ void update_key_and_cert_if_needed(void) { return; } - if ((keystat.st_mtime > cert_mtime) || (certstat.st_mtime > cert_mtime)) { + if ((keystat.st_mtime + certstat.st_mtime) != previous_mtime) { bind_to_key_and_certificate(); - cert_mtime = certstat.st_mtime; + previous_mtime = keystat.st_mtime + certstat.st_mtime; } }