Deleted Added
full compact
job.c (236769) job.c (237578)
1/* $NetBSD: job.c,v 1.161 2012/04/07 18:29:08 christos Exp $ */
1/* $NetBSD: job.c,v 1.162 2012/06/12 19:21:50 joerg Exp $ */
2
3/*
4 * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor.
9 *

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

65 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69 * SUCH DAMAGE.
70 */
71
72#ifndef MAKE_NATIVE
2
3/*
4 * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor.
9 *

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

65 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69 * SUCH DAMAGE.
70 */
71
72#ifndef MAKE_NATIVE
73static char rcsid[] = "$NetBSD: job.c,v 1.161 2012/04/07 18:29:08 christos Exp $";
73static char rcsid[] = "$NetBSD: job.c,v 1.162 2012/06/12 19:21:50 joerg Exp $";
74#else
75#include <sys/cdefs.h>
76#ifndef lint
77#if 0
78static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
79#else
74#else
75#include <sys/cdefs.h>
76#ifndef lint
77#if 0
78static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
79#else
80__RCSID("$NetBSD: job.c,v 1.161 2012/04/07 18:29:08 christos Exp $");
80__RCSID("$NetBSD: job.c,v 1.162 2012/06/12 19:21:50 joerg Exp $");
81#endif
82#endif /* not lint */
83#endif
84
85/*-
86 * job.c --
87 * handle the creation etc. of our child processes.
88 *

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

360static int JobSaveCommand(void *, void *);
361static void JobClose(Job *);
362static void JobExec(Job *, char **);
363static void JobMakeArgv(Job *, char **);
364static int JobStart(GNode *, int);
365static char *JobOutput(Job *, char *, char *, int);
366static void JobDoOutput(Job *, Boolean);
367static Shell *JobMatchShell(const char *);
81#endif
82#endif /* not lint */
83#endif
84
85/*-
86 * job.c --
87 * handle the creation etc. of our child processes.
88 *

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

360static int JobSaveCommand(void *, void *);
361static void JobClose(Job *);
362static void JobExec(Job *, char **);
363static void JobMakeArgv(Job *, char **);
364static int JobStart(GNode *, int);
365static char *JobOutput(Job *, char *, char *, int);
366static void JobDoOutput(Job *, Boolean);
367static Shell *JobMatchShell(const char *);
368static void JobInterrupt(int, int) __dead;
368static void JobInterrupt(int, int) MAKE_ATTR_DEAD;
369static void JobRestartJobs(void);
370static void JobTokenAdd(void);
371static void JobSigLock(sigset_t *);
372static void JobSigUnlock(sigset_t *);
373static void JobSigReset(void);
374
375const char *malloc_options="A";
376

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

483 *
484 * Side Effects:
485 * Sends a token on the child exit pipe to wake us up from
486 * select()/poll().
487 *
488 *-----------------------------------------------------------------------
489 */
490static void
369static void JobRestartJobs(void);
370static void JobTokenAdd(void);
371static void JobSigLock(sigset_t *);
372static void JobSigUnlock(sigset_t *);
373static void JobSigReset(void);
374
375const char *malloc_options="A";
376

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

483 *
484 * Side Effects:
485 * Sends a token on the child exit pipe to wake us up from
486 * select()/poll().
487 *
488 *-----------------------------------------------------------------------
489 */
490static void
491JobChildSig(int signo __unused)
491JobChildSig(int signo MAKE_ATTR_UNUSED)
492{
493 write(childExitJob.outPipe, CHILD_EXIT, 1);
494}
495
496
497/*-
498 *-----------------------------------------------------------------------
499 * JobContinueSig --

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

506 * None.
507 *
508 * Side Effects:
509 * Jobs start running again.
510 *
511 *-----------------------------------------------------------------------
512 */
513static void
492{
493 write(childExitJob.outPipe, CHILD_EXIT, 1);
494}
495
496
497/*-
498 *-----------------------------------------------------------------------
499 * JobContinueSig --

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

506 * None.
507 *
508 * Side Effects:
509 * Jobs start running again.
510 *
511 *-----------------------------------------------------------------------
512 */
513static void
514JobContinueSig(int signo __unused)
514JobContinueSig(int signo MAKE_ATTR_UNUSED)
515{
516 /*
517 * Defer sending to SIGCONT to our stopped children until we return
518 * from the signal handler.
519 */
520 write(childExitJob.outPipe, DO_JOB_RESUME, 1);
521}
522

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

531 * Results:
532 * None.
533 *
534 * Side Effects:
535 * We die by the same signal.
536 *
537 *-----------------------------------------------------------------------
538 */
515{
516 /*
517 * Defer sending to SIGCONT to our stopped children until we return
518 * from the signal handler.
519 */
520 write(childExitJob.outPipe, DO_JOB_RESUME, 1);
521}
522

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

531 * Results:
532 * None.
533 *
534 * Side Effects:
535 * We die by the same signal.
536 *
537 *-----------------------------------------------------------------------
538 */
539__dead static void
539MAKE_ATTR_DEAD static void
540JobPassSig_int(int signo)
541{
542 /* Run .INTERRUPT target then exit */
543 JobInterrupt(TRUE, signo);
544}
545
540JobPassSig_int(int signo)
541{
542 /* Run .INTERRUPT target then exit */
543 JobInterrupt(TRUE, signo);
544}
545
546__dead static void
546MAKE_ATTR_DEAD static void
547JobPassSig_term(int signo)
548{
549 /* Dont run .INTERRUPT target then exit */
550 JobInterrupt(FALSE, signo);
551}
552
553static void
554JobPassSig_suspend(int signo)

--- 2434 unchanged lines hidden ---
547JobPassSig_term(int signo)
548{
549 /* Dont run .INTERRUPT target then exit */
550 JobInterrupt(FALSE, signo);
551}
552
553static void
554JobPassSig_suspend(int signo)

--- 2434 unchanged lines hidden ---