libc: fix handling of __set_errno(SUCCESS)

This commit is contained in:
2026-05-30 10:05:28 +01:00
parent 0f0cc44f7c
commit df1662aa10
+2 -2
View File
@@ -11,7 +11,7 @@ int __attribute__((weak)) * __errno_location(void)
#if defined(BUILD_STATIC)
int __set_errno(int err)
{
return -err;
return err == 0 ? 0 : -err;
}
#endif
@@ -20,7 +20,7 @@ int __set_errno(int err)
{
/* TODO */
*__errno_location() = err;
return -1;
return err == 0 ? 0 : -1;
}
#endif