diff options
author | Petri Latvala <petri.latvala@intel.com> | 2020-07-21 12:12:53 +0300 |
---|---|---|
committer | Petri Latvala <petri.latvala@intel.com> | 2020-07-22 12:50:18 +0300 |
commit | b4963876f7ed65604f7d9d714a727485f3a9c136 (patch) | |
tree | 7af380eb218cf842c93c313dc13a8402b7ed0cb3 /runner | |
parent | f0ddc00a492f49faceaebafec7e55adbf62e46fb (diff) |
runner: Use exitcode 127 when resume is impossible
igt_resume is typically used in a scripted loop, with automatic
reboots and retries. It already uses separate exit codes for being
done (0), requiring a reboot and a retry (1) and requiring a retry due
to exceeding its overall time quota (2). Introduce another exit code,
127, for circumstances where execution in the given directory is
impossible and retrying would never terminate. One example case is
a kernel bug causing the filesystem to go enough bonkers to make the
runner settings files disappear.
As a drive-by improvement, also print something when that happens.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'runner')
-rw-r--r-- | runner/resume.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runner/resume.c b/runner/resume.c index d5a20e80..f5d69e21 100644 --- a/runner/resume.c +++ b/runner/resume.c @@ -28,11 +28,12 @@ int main(int argc, char **argv) if ((dirfd = open(argv[1], O_RDONLY | O_DIRECTORY)) < 0) { fprintf(stderr, "Failure opening %s: %s\n", argv[1], strerror(errno)); - return 1; + return 127; } if (!initialize_execute_state_from_resume(dirfd, &state, &settings, &job_list)) { - return 1; + fprintf(stderr, "Failure reading metadata in %s\n", argv[1]); + return 127; } if (!execute(&state, &settings, &job_list)) { |