diff options
author | Tuukka Tikkanen <tuukka.tikkanen@linaro.org> | 2015-01-13 19:53:15 +0200 |
---|---|---|
committer | Tuukka Tikkanen <tuukka.tikkanen@linaro.org> | 2015-01-13 19:53:15 +0200 |
commit | 11706469d76826e4e6f967969c4487f6e7ebc71c (patch) | |
tree | 5ed65ac56001080b4f1ed9b2a475aa10426becd5 | |
parent | e776936ab69d309084e464e0c8dfccb822ba500a (diff) |
Energy model: Do not exit() with a negative status code
Process status codes are positive integers. Parse_energy_model()
would use the return value of make_energy_model_template()
directly as a parameter to call to exit(). In case of an error,
this would translate to exit(-1), which is incorrect. This
patch makes all non-zero return value from energy model
template creation get traslated to 1.
Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
-rw-r--r-- | energy_model.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/energy_model.c b/energy_model.c index 7a0ba8a..cbf3223 100644 --- a/energy_model.c +++ b/energy_model.c @@ -141,7 +141,7 @@ int parse_energy_model(struct program_options *options) return -1; } ret = make_energy_model_template(options); - exit(ret); + exit(ret ? 1 : 0); } fprintf(stderr, "%s: failed to open '%s': %m\n", __func__, path); return -1; |