Deleted Added
full compact
hastd.c (213428) hastd.c (213429)
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 213428 2010-10-04 21:41:18Z pjd $");
32__FBSDID("$FreeBSD: head/sbin/hastd/hastd.c 213429 2010-10-04 21:43:06Z 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>

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

654 assert(fd >= 0);
655 FD_SET(fd, &rfds);
656 maxfd = fd > maxfd ? fd : maxfd;
657 }
658
659 assert(maxfd + 1 <= (int)FD_SETSIZE);
660 ret = select(maxfd + 1, &rfds, NULL, NULL, &seltimeout);
661 if (ret == 0)
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>

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

654 assert(fd >= 0);
655 FD_SET(fd, &rfds);
656 maxfd = fd > maxfd ? fd : maxfd;
657 }
658
659 assert(maxfd + 1 <= (int)FD_SETSIZE);
660 ret = select(maxfd + 1, &rfds, NULL, NULL, &seltimeout);
661 if (ret == 0)
662 hook_check(false);
662 hook_check();
663 else if (ret == -1) {
664 if (errno == EINTR)
665 continue;
666 KEEP_ERRNO((void)pidfile_remove(pfh));
667 pjdlog_exit(EX_OSERR, "select() failed");
668 }
669
670 if (FD_ISSET(proto_descriptor(cfg->hc_controlconn), &rfds))

--- 128 unchanged lines hidden ---
663 else if (ret == -1) {
664 if (errno == EINTR)
665 continue;
666 KEEP_ERRNO((void)pidfile_remove(pfh));
667 pjdlog_exit(EX_OSERR, "select() failed");
668 }
669
670 if (FD_ISSET(proto_descriptor(cfg->hc_controlconn), &rfds))

--- 128 unchanged lines hidden ---