=?UTF-8?Q?Iv=C3=A1n=20Matellanes=20?=: msvcirt: Set the error flag in writepad without locking.

Alexandre Julliard julliard at winehq.org
Thu Jun 23 11:15:24 CDT 2016


Module: wine
Branch: master
Commit: 3be6ac0d338f6908ca5cbd2e10fc0fb87238e618
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3be6ac0d338f6908ca5cbd2e10fc0fb87238e618

Author: Iván Matellanes <matellanesivan at gmail.com>
Date:   Thu Jun 23 10:46:59 2016 +0100

msvcirt: Set the error flag in writepad without locking.

writepad() is always called between opfx() and osfx(), so the ios object is already locked.

Signed-off-by: Iván Matellanes <matellanes.ivan at gmail.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcirt/msvcirt.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c
index 666c44c..5f44854 100644
--- a/dlls/msvcirt/msvcirt.c
+++ b/dlls/msvcirt/msvcirt.c
@@ -2572,22 +2572,22 @@ ostream* __thiscall ostream_writepad(ostream *this, const char *str1, const char
     /* left of the padding */
     if (base->flags & (FLAGS_left|FLAGS_internal)) {
         if (streambuf_sputn(base->sb, str1, len1) != len1)
-            ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit);
+            base->state |= IOSTATE_failbit | IOSTATE_badbit;
         if (!(base->flags & FLAGS_internal))
             if (streambuf_sputn(base->sb, str2, len2) != len2)
-                ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit);
+                base->state |= IOSTATE_failbit | IOSTATE_badbit;
     }
     /* add padding to fill the width */
     for (i = len1 + len2; i < base->width; i++)
         if (streambuf_sputc(base->sb, base->fill) == EOF)
-            ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit);
+            base->state |= IOSTATE_failbit | IOSTATE_badbit;
     /* right of the padding */
     if ((base->flags & (FLAGS_left|FLAGS_internal)) != FLAGS_left) {
         if (!(base->flags & (FLAGS_left|FLAGS_internal)))
             if (streambuf_sputn(base->sb, str1, len1) != len1)
-                ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit);
+                base->state |= IOSTATE_failbit | IOSTATE_badbit;
         if (streambuf_sputn(base->sb, str2, len2) != len2)
-            ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit);
+            base->state |= IOSTATE_failbit | IOSTATE_badbit;
     }
     return this;
 }




More information about the wine-cvs mailing list