kernel/tools/testing/selftests/proc/proc-uptime-002.c
.. .. @@ -17,6 +17,7 @@ 17 17 // while shifting across CPUs. 18 18 #undef NDEBUG 19 19 #include <assert.h> 20 +#include <errno.h>20 21 #include <unistd.h> 21 22 #include <sys/syscall.h> 22 23 #include <stdlib.h> .. .. @@ -54,7 +55,7 @@ 54 55 len += sizeof(unsigned long); 55 56 free(m); 56 57 m = malloc(len); 57 - } while (sys_sched_getaffinity(0, len, m) == -EINVAL);58 + } while (sys_sched_getaffinity(0, len, m) == -1 && errno == EINVAL);58 59 59 60 fd = open("/proc/uptime", O_RDONLY); 60 61 assert(fd >= 0);