Deleted Added
full compact
timeout.c (268745) timeout.c (268746)
1/*-
2 * Copyright (c) 2014 Baptiste Daroussin <bapt@FreeBSD.org>
3 * Copyright (c) 2014 Vsevolod Stakhov <vsevolod@FreeBSD.org>
4 * All rights reserved.
5 *~
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2014 Baptiste Daroussin <bapt@FreeBSD.org>
3 * Copyright (c) 2014 Vsevolod Stakhov <vsevolod@FreeBSD.org>
4 * All rights reserved.
5 *~
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/usr.bin/timeout/timeout.c 268745 2014-07-16 09:55:36Z bapt $");
29__FBSDID("$FreeBSD: head/usr.bin/timeout/timeout.c 268746 2014-07-16 10:34:55Z bapt $");
30
31#include <sys/types.h>
32#include <sys/time.h>
33#include <sys/wait.h>
34#include <signal.h>
35#include <stdio.h>
36#include <stdlib.h>
37#include <string.h>

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

325 }
326
327 if (WEXITSTATUS(pstat))
328 pstat = WEXITSTATUS(pstat);
329 else if(WIFSIGNALED(pstat))
330 pstat = 128 + WTERMSIG(pstat);
331
332 if (timedout && !preserve)
30
31#include <sys/types.h>
32#include <sys/time.h>
33#include <sys/wait.h>
34#include <signal.h>
35#include <stdio.h>
36#include <stdlib.h>
37#include <string.h>

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

325 }
326
327 if (WEXITSTATUS(pstat))
328 pstat = WEXITSTATUS(pstat);
329 else if(WIFSIGNALED(pstat))
330 pstat = 128 + WTERMSIG(pstat);
331
332 if (timedout && !preserve)
333 pstat = EXIT_TIMEOUT;
333 pstat = EXIT_TIMEOUT;
334
335 return (pstat);
336}
334
335 return (pstat);
336}