diff options
author | Matias Elo <matias.elo@nokia.com> | 2018-09-26 13:25:06 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2018-10-04 15:15:31 +0300 |
commit | 6e3954910345b19f596fa35a3427c432ffaa0ecf (patch) | |
tree | dd9ce9a7578631cae0059a19b75a2f46988d69a9 /helper/threads.c | |
parent | e86f2adb4c33cf047f6521149d67a340288dc8ca (diff) |
helper: threads: add ODPH_PROC_MODE environment variable
ODPH_PROC_MODE environment variable can be used to enable process mode.
Setting environment variable is simpler in CI compared to using command
line arguments.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper/threads.c')
-rw-r--r-- | helper/threads.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/helper/threads.c b/helper/threads.c index 86d6bf7be..f1f638752 100644 --- a/helper/threads.c +++ b/helper/threads.c @@ -10,6 +10,7 @@ #define _GNU_SOURCE #endif #include <sched.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/wait.h> @@ -332,10 +333,18 @@ int odph_odpthread_getaffinity(void) int odph_parse_options(int argc, char *argv[]) { + char *env; int i, j; helper_options.proc = 0; + /* Enable process mode using environment variable. Setting environment + * variable is easier for CI testing compared to command line + * argument. */ + env = getenv("ODPH_PROC_MODE"); + if (env && atoi(env)) + helper_options.proc = 1; + /* Find and remove option */ for (i = 0; i < argc;) { if (strcmp(argv[i], "--odph_proc") == 0) { |