mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-20 21:02:59 +00:00
Reset errno to 0 after success
errno is only valid after a syscall wrapper (e.g. ioctl()) reports an error. However, we report the last errno value as a part of the igt_assert() output and so we display spurious values such as: Test requirement not met in function gem_require_ring, file ioctl_wrappers.c:802: Last errno: 11, Resource temporarily unavailable Test requirement: (!((((intel_get_drm_devid(fd)) == 0x0102 || ... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
+5
-1
@@ -32,6 +32,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/mman.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <xf86drm.h>
|
||||
|
||||
@@ -94,6 +95,9 @@ void gem_quiescent_gpu(int fd);
|
||||
* This macro wraps drmIoctl() and uses igt_assert to check that it has been
|
||||
* successfully executed.
|
||||
*/
|
||||
#define do_ioctl(fd, ioc, ioc_data) igt_assert(drmIoctl((fd), (ioc), (ioc_data)) == 0)
|
||||
#define do_ioctl(fd, ioc, ioc_data) do { \
|
||||
igt_assert(drmIoctl((fd), (ioc), (ioc_data)) == 0); \
|
||||
errno = 0; \
|
||||
} while (0)
|
||||
|
||||
#endif /* DRMTEST_H */
|
||||
|
||||
Reference in New Issue
Block a user