Deleted Added
full compact
secondary.c (218138) secondary.c (218214)
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 218138 2011-01-31 18:32:17Z pjd $");
32__FBSDID("$FreeBSD: head/sbin/hastd/secondary.c 218214 2011-02-03 10:37:44Z 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>

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

409 if (proto_timeout(res->hr_remoteout, res->hr_timeout) < 0)
410 pjdlog_errno(LOG_WARNING, "Unable to set connection timeout");
411
412 init_local(res);
413 init_environment();
414
415 if (drop_privs() != 0)
416 exit(EX_CONFIG);
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>

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

409 if (proto_timeout(res->hr_remoteout, res->hr_timeout) < 0)
410 pjdlog_errno(LOG_WARNING, "Unable to set connection timeout");
411
412 init_local(res);
413 init_environment();
414
415 if (drop_privs() != 0)
416 exit(EX_CONFIG);
417 pjdlog_info("Privileges successfully dropped.");
417
418 /*
419 * Create the control thread before sending any event to the parent,
420 * as we can deadlock when parent sends control request to worker,
421 * but worker has no control thread started yet, so parent waits.
422 * In the meantime worker sends an event to the parent, but parent
423 * is unable to handle the event, because it waits for control
424 * request response.

--- 344 unchanged lines hidden ---
418
419 /*
420 * Create the control thread before sending any event to the parent,
421 * as we can deadlock when parent sends control request to worker,
422 * but worker has no control thread started yet, so parent waits.
423 * In the meantime worker sends an event to the parent, but parent
424 * is unable to handle the event, because it waits for control
425 * request response.

--- 344 unchanged lines hidden ---