]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
libio: Avoid RMW of flags2 outside lock (BZ #27842)
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Fri, 10 Jun 2022 12:33:26 +0000 (13:33 +0100)
committerWilco Dijkstra <wdijkstr@arm.com>
Fri, 10 Jun 2022 12:35:57 +0000 (13:35 +0100)
Remove an unconditional RMW on flags2 in flockfile - we don't need to change
_IO_FLAGS2_NEED_LOCK since it isn't used in flockfile or funlockfile.
This fixes BZ #27842.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
stdio-common/flockfile.c

index a5decb450f8d477e3105d02661282afeab58f88b..49f72c69ab7a4ccca6f21d443c6fc3a0eca76376 100644 (file)
@@ -22,7 +22,6 @@
 void
 __flockfile (FILE *stream)
 {
-  stream->_flags2 |= _IO_FLAGS2_NEED_LOCK;
   _IO_lock_lock (*stream->_lock);
 }
 weak_alias (__flockfile, flockfile);