From d5bf9182dd2d2678dc43f38109282850c63bd63a Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Sun, 30 May 2021 17:26:24 +0200 Subject: [PATCH] LibC: Don't clear errno on success POSIX (`errno(3p)`) states that errno should not be set to zero. This helps with applications that don't expect errno to get updated unless an intermediate syscall also fails. --- Userland/Libraries/LibC/errno.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Userland/Libraries/LibC/errno.h b/Userland/Libraries/LibC/errno.h index 6759595e84..449d6d2bdb 100644 --- a/Userland/Libraries/LibC/errno.h +++ b/Userland/Libraries/LibC/errno.h @@ -15,7 +15,6 @@ errno = -rc; \ return (bad_ret); \ } \ - errno = 0; \ return (good_ret); \ } while (0)