hastd.c (210886) | hastd.c (211886) |
---|---|
1/*- 2 * Copyright (c) 2009-2010 The FreeBSD Foundation 3 * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org> 4 * All rights reserved. 5 * 6 * This software was developed by Pawel Jakub Dawidek under sponsorship from 7 * the FreeBSD Foundation. 8 * --- 15 unchanged lines hidden (view full) --- 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009-2010 The FreeBSD Foundation 3 * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org> 4 * All rights reserved. 5 * 6 * This software was developed by Pawel Jakub Dawidek under sponsorship from 7 * the FreeBSD Foundation. 8 * --- 15 unchanged lines hidden (view full) --- 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sbin/hastd/hastd.c 210886 2010-08-05 19:16:31Z pjd $"); | 32__FBSDID("$FreeBSD: head/sbin/hastd/hastd.c 211886 2010-08-27 15:16:52Z pjd $"); |
33 34#include <sys/param.h> 35#include <sys/linker.h> 36#include <sys/module.h> 37#include <sys/wait.h> 38 39#include <assert.h> 40#include <err.h> --- 16 unchanged lines hidden (view full) --- 57#include "hastd.h" 58#include "subr.h" 59 60/* Path to configuration file. */ 61const char *cfgpath = HAST_CONFIG; 62/* Hastd configuration. */ 63static struct hastd_config *cfg; 64/* Was SIGCHLD signal received? */ | 33 34#include <sys/param.h> 35#include <sys/linker.h> 36#include <sys/module.h> 37#include <sys/wait.h> 38 39#include <assert.h> 40#include <err.h> --- 16 unchanged lines hidden (view full) --- 57#include "hastd.h" 58#include "subr.h" 59 60/* Path to configuration file. */ 61const char *cfgpath = HAST_CONFIG; 62/* Hastd configuration. */ 63static struct hastd_config *cfg; 64/* Was SIGCHLD signal received? */ |
65static bool sigchld_received = false; | 65bool sigchld_received = false; |
66/* Was SIGHUP signal received? */ 67bool sighup_received = false; 68/* Was SIGINT or SIGTERM signal received? */ 69bool sigexit_received = false; 70/* PID file handle. */ 71struct pidfh *pfh; 72 73static void --- 110 unchanged lines hidden (view full) --- 184 if (res0->hr_role == HAST_ROLE_INIT || 185 res0->hr_role == HAST_ROLE_SECONDARY) { 186 if (strcmp(res0->hr_remoteaddr, res1->hr_remoteaddr) != 0) 187 return (true); 188 if (res0->hr_replication != res1->hr_replication) 189 return (true); 190 if (res0->hr_timeout != res1->hr_timeout) 191 return (true); | 66/* Was SIGHUP signal received? */ 67bool sighup_received = false; 68/* Was SIGINT or SIGTERM signal received? */ 69bool sigexit_received = false; 70/* PID file handle. */ 71struct pidfh *pfh; 72 73static void --- 110 unchanged lines hidden (view full) --- 184 if (res0->hr_role == HAST_ROLE_INIT || 185 res0->hr_role == HAST_ROLE_SECONDARY) { 186 if (strcmp(res0->hr_remoteaddr, res1->hr_remoteaddr) != 0) 187 return (true); 188 if (res0->hr_replication != res1->hr_replication) 189 return (true); 190 if (res0->hr_timeout != res1->hr_timeout) 191 return (true); |
192 if (strcmp(res0->hr_exec, res1->hr_exec) != 0) 193 return (true); |
|
192 } 193 return (false); 194} 195 196static bool 197resource_needs_reload(const struct hast_resource *res0, 198 const struct hast_resource *res1) 199{ --- 6 unchanged lines hidden (view full) --- 206 return (false); 207 208 if (strcmp(res0->hr_remoteaddr, res1->hr_remoteaddr) != 0) 209 return (true); 210 if (res0->hr_replication != res1->hr_replication) 211 return (true); 212 if (res0->hr_timeout != res1->hr_timeout) 213 return (true); | 194 } 195 return (false); 196} 197 198static bool 199resource_needs_reload(const struct hast_resource *res0, 200 const struct hast_resource *res1) 201{ --- 6 unchanged lines hidden (view full) --- 208 return (false); 209 210 if (strcmp(res0->hr_remoteaddr, res1->hr_remoteaddr) != 0) 211 return (true); 212 if (res0->hr_replication != res1->hr_replication) 213 return (true); 214 if (res0->hr_timeout != res1->hr_timeout) 215 return (true); |
216 if (strcmp(res0->hr_exec, res1->hr_exec) != 0) 217 return (true); |
|
214 return (false); 215} 216 217static void 218hastd_reload(void) 219{ 220 struct hastd_config *newcfg; 221 struct hast_resource *nres, *cres, *tres; --- 505 unchanged lines hidden --- | 218 return (false); 219} 220 221static void 222hastd_reload(void) 223{ 224 struct hastd_config *newcfg; 225 struct hast_resource *nres, *cres, *tres; --- 505 unchanged lines hidden --- |