summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/proc/proc-uptime-002.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/proc/proc-uptime-002.c')
-rw-r--r--tools/testing/selftests/proc/proc-uptime-002.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/proc/proc-uptime-002.c b/tools/testing/selftests/proc/proc-uptime-002.c
index e7ceabed7..7d0aa22bd 100644
--- a/tools/testing/selftests/proc/proc-uptime-002.c
+++ b/tools/testing/selftests/proc/proc-uptime-002.c
@@ -17,6 +17,7 @@
// while shifting across CPUs.
#undef NDEBUG
#include <assert.h>
+#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <stdlib.h>
@@ -54,7 +55,7 @@ int main(void)
len += sizeof(unsigned long);
free(m);
m = malloc(len);
- } while (sys_sched_getaffinity(0, len, m) == -EINVAL);
+ } while (sys_sched_getaffinity(0, len, m) == -1 && errno == EINVAL);
fd = open("/proc/uptime", O_RDONLY);
assert(fd >= 0);