diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-04-29 07:14:33 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-04-29 07:17:30 +0100 |
commit | c1404e05b7477122b9923ba029593c2cb64671a7 (patch) | |
tree | c759c7600dd65d80e9564283230acec871069c1b | |
parent | fa86e33ccc56ee84f2f9ac924943eef0f1469a32 (diff) |
errno is reset after each syscall
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78055
Bugilla: https://bugs.freedesktop.org/show_bug.cgi?id=78053
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/gem_exec_bad_domains.c | 3 | ||||
-rw-r--r-- | tests/gem_lut_handle.c | 7 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/gem_exec_bad_domains.c b/tests/gem_exec_bad_domains.c index 6fb9edb6..7641f8f8 100644 --- a/tests/gem_exec_bad_domains.c +++ b/tests/gem_exec_bad_domains.c @@ -141,11 +141,10 @@ static void multi_write_domain(int fd) ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); + igt_assert(ret != 0 && errno == EINVAL); gem_close(fd, handle); gem_close(fd, handle_target); - - igt_assert(ret != 0 && errno == EINVAL); } int fd; diff --git a/tests/gem_lut_handle.c b/tests/gem_lut_handle.c index e682ccf7..705e8b33 100644 --- a/tests/gem_lut_handle.c +++ b/tests/gem_lut_handle.c @@ -154,6 +154,8 @@ static int many_exec(int fd, uint32_t batch, int num_exec, int num_reloc, unsign ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); + if (ret < 0) + ret = -errno; for (n = 0; n < num_exec; n++) gem_close(fd, gem_exec[n].handle); @@ -164,7 +166,7 @@ static int many_exec(int fd, uint32_t batch, int num_exec, int num_reloc, unsign return ret; } -#define _fail(x) ((x) == -1 && errno == ENOENT) +#define _fail(x) ((x) == -ENOENT) #define ASSERT(x) do { \ if (!(x)) { \ fprintf(stderr, "%s:%d failed, errno=%d\n", \ @@ -195,8 +197,7 @@ igt_simple_main fail(exec(fd, handle, USE_LUT | BROKEN)); for (i = 2; i <= SLOW_QUICK(65536, 8); i *= 2) { - if (many_exec(fd, handle, i+1, i+1, NORMAL) == -1 && - errno == ENOSPC) + if (many_exec(fd, handle, i+1, i+1, NORMAL) == -ENOSPC) break; pass(many_exec(fd, handle, i-1, i-1, NORMAL)); |