add copy_file_range system call wrapper
[musl] / src / unistd / setxid.c
index 9e37ddc..0239f8a 100644 (file)
@@ -32,7 +32,7 @@ int __setxid(int nr, int id, int eid, int sid)
        struct ctx c = { .nr = nr, .id = id, .eid = eid, .sid = sid, .err = -1 };
        __synccall(do_setxid, &c);
        if (c.err) {
-               errno = c.err;
+               if (c.err>0) errno = c.err;
                return -1;
        }
        return 0;