From 1f848981901657d61e01538505982c5c71a32494 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 24 Nov 2011 23:27:59 +0100 Subject: [PATCH] Let ErrnoMaintainer restore errno unconditionally. * we never want to let ICU calls change the errno at all, so we always restore it to the value it had before entering ICU (not just if it was 0) --- headers/private/libroot/ErrnoMaintainer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/private/libroot/ErrnoMaintainer.h b/headers/private/libroot/ErrnoMaintainer.h index c01f3d912e..f0de2bcf0a 100644 --- a/headers/private/libroot/ErrnoMaintainer.h +++ b/headers/private/libroot/ErrnoMaintainer.h @@ -25,9 +25,9 @@ public: ~ErrnoMaintainer() { - if (errno != 0 && fErrnoUponEntry == 0) - errno = 0; + errno = fErrnoUponEntry; } + private: int fErrnoUponEntry; };