getaddrinfo: add EAI_NODATA error code to distinguish NODATA vs NxDomain
[musl] / src / internal / syscall_ret.c
index 4f159e0..a3f4713 100644 (file)
@@ -1,11 +1,11 @@
 #include <errno.h>
-#include <unistd.h>
+#include "syscall.h"
 
 long __syscall_ret(unsigned long r)
 {
-       if (r >= (unsigned long)-1 - 4096) {
-               errno = -(long)r;
+       if (r > -4096UL) {
+               errno = -r;
                return -1;
        }
-       return (long)r;
+       return r;
 }