mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-15 15:40:12 +00:00
login: Remove double-assignment of fl.l_whence in try_file_lock
Since l_whence is the second member of struct flock, it is written
twice. The double-assignment is technically undefined behavior due to
the lack of a sequence point.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Change-Id: I2baf9e70690e723c61051b25ccbd510aec15976c
(cherry picked from commit b0a83ae71b
)
This commit is contained in:
parent
f0cd1cfbe3
commit
143cea84a0
@ -79,7 +79,7 @@ try_file_lock (int fd, int type)
|
||||
struct flock64 fl =
|
||||
{
|
||||
.l_type = type,
|
||||
fl.l_whence = SEEK_SET,
|
||||
.l_whence = SEEK_SET,
|
||||
};
|
||||
|
||||
bool status = __fcntl64_nocancel (fd, F_SETLKW, &fl) < 0;
|
||||
|
Loading…
Reference in New Issue
Block a user