Deleted Added
full compact
secondary.c (220865) secondary.c (221899)
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/secondary.c 220865 2011-04-19 19:26:27Z pjd $");
32__FBSDID("$FreeBSD: head/sbin/hastd/secondary.c 221899 2011-05-14 17:02:03Z pjd $");
33
34#include <sys/param.h>
35#include <sys/time.h>
36#include <sys/bio.h>
37#include <sys/disk.h>
38#include <sys/stat.h>
39
40#include <err.h>

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

431 if (proto_timeout(res->hr_remotein, 2 * HAST_KEEPALIVE) < 0)
432 pjdlog_errno(LOG_WARNING, "Unable to set connection timeout");
433 if (proto_timeout(res->hr_remoteout, res->hr_timeout) < 0)
434 pjdlog_errno(LOG_WARNING, "Unable to set connection timeout");
435
436 init_local(res);
437 init_environment();
438
33
34#include <sys/param.h>
35#include <sys/time.h>
36#include <sys/bio.h>
37#include <sys/disk.h>
38#include <sys/stat.h>
39
40#include <err.h>

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

431 if (proto_timeout(res->hr_remotein, 2 * HAST_KEEPALIVE) < 0)
432 pjdlog_errno(LOG_WARNING, "Unable to set connection timeout");
433 if (proto_timeout(res->hr_remoteout, res->hr_timeout) < 0)
434 pjdlog_errno(LOG_WARNING, "Unable to set connection timeout");
435
436 init_local(res);
437 init_environment();
438
439 if (drop_privs(true) != 0)
439 if (drop_privs(res) != 0)
440 exit(EX_CONFIG);
441 pjdlog_info("Privileges successfully dropped.");
442
443 /*
444 * Create the control thread before sending any event to the parent,
445 * as we can deadlock when parent sends control request to worker,
446 * but worker has no control thread started yet, so parent waits.
447 * In the meantime worker sends an event to the parent, but parent

--- 346 unchanged lines hidden ---
440 exit(EX_CONFIG);
441 pjdlog_info("Privileges successfully dropped.");
442
443 /*
444 * Create the control thread before sending any event to the parent,
445 * as we can deadlock when parent sends control request to worker,
446 * but worker has no control thread started yet, so parent waits.
447 * In the meantime worker sends an event to the parent, but parent

--- 346 unchanged lines hidden ---