Deleted Added
full compact
hastd.c (217967) hastd.c (218041)
1/*-
2 * Copyright (c) 2009-2010 The FreeBSD Foundation
1/*-
2 * Copyright (c) 2009-2010 The FreeBSD Foundation
3 * Copyright (c) 2010 Pawel Jakub Dawidek
3 * Copyright (c) 2010-2011 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 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:

--- 12 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>
4 * All rights reserved.
5 *
6 * This software was developed by Pawel Jakub Dawidek under sponsorship from
7 * the FreeBSD Foundation.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:

--- 12 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 217967 2011-01-27 19:31:35Z pjd $");
32__FBSDID("$FreeBSD: head/sbin/hastd/hastd.c 218041 2011-01-28 21:48:15Z 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>

--- 47 unchanged lines hidden (view full) ---

88 if (errno != EEXIST) {
89 pjdlog_exit(EX_OSERR,
90 "Unable to load geom_gate module");
91 }
92 }
93 }
94}
95
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>

--- 47 unchanged lines hidden (view full) ---

88 if (errno != EEXIST) {
89 pjdlog_exit(EX_OSERR,
90 "Unable to load geom_gate module");
91 }
92 }
93 }
94}
95
96void
97descriptors_cleanup(struct hast_resource *res)
98{
99 struct hast_resource *tres;
100
101 TAILQ_FOREACH(tres, &cfg->hc_resources, hr_next) {
102 if (tres == res) {
103 PJDLOG_VERIFY(res->hr_role == HAST_ROLE_SECONDARY ||
104 (res->hr_remotein == NULL &&
105 res->hr_remoteout == NULL));
106 continue;
107 }
108 if (tres->hr_remotein != NULL)
109 proto_close(tres->hr_remotein);
110 if (tres->hr_remoteout != NULL)
111 proto_close(tres->hr_remoteout);
112 }
113 if (cfg->hc_controlin != NULL)
114 proto_close(cfg->hc_controlin);
115 proto_close(cfg->hc_controlconn);
116 proto_close(cfg->hc_listenconn);
117 (void)pidfile_close(pfh);
118 hook_fini();
119 pjdlog_fini();
120}
121
96static void
97child_exit_log(unsigned int pid, int status)
98{
99
100 if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
101 pjdlog_debug(1, "Worker process exited gracefully (pid=%u).",
102 pid);
103 } else if (WIFSIGNALED(status)) {

--- 746 unchanged lines hidden ---
122static void
123child_exit_log(unsigned int pid, int status)
124{
125
126 if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
127 pjdlog_debug(1, "Worker process exited gracefully (pid=%u).",
128 pid);
129 } else if (WIFSIGNALED(status)) {

--- 746 unchanged lines hidden ---