-// 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.
// 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;
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;
}
}