.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright 2013, Michael Ellerman, IBM Corp. |
---|
3 | | - * Licensed under GPLv2. |
---|
4 | 4 | */ |
---|
5 | 5 | |
---|
6 | 6 | #include <errno.h> |
---|
.. | .. |
---|
21 | 21 | |
---|
22 | 22 | #define KILL_TIMEOUT 5 |
---|
23 | 23 | |
---|
| 24 | +/* Setting timeout to -1 disables the alarm */ |
---|
24 | 25 | static uint64_t timeout = 120; |
---|
25 | 26 | |
---|
26 | 27 | int run_test(int (test_function)(void), char *name) |
---|
.. | .. |
---|
43 | 44 | |
---|
44 | 45 | setpgid(pid, pid); |
---|
45 | 46 | |
---|
46 | | - /* Wake us up in timeout seconds */ |
---|
47 | | - alarm(timeout); |
---|
| 47 | + if (timeout != -1) |
---|
| 48 | + /* Wake us up in timeout seconds */ |
---|
| 49 | + alarm(timeout); |
---|
48 | 50 | terminated = false; |
---|
49 | 51 | |
---|
50 | 52 | wait: |
---|