diff options
author | Florian Weimer <fweimer@redhat.com> | 2019-11-07 09:53:41 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2019-11-07 09:54:33 +0100 |
commit | b0a83ae71b2588bd2a9e6b40f95191602940e01e (patch) | |
tree | 3ca57316ab3aa9837d1d75ebd0c25c71dcbb4e15 /login | |
parent | a673c07af3bcfa24432c3fd8a1dea12f931ee903 (diff) | |
download | glibc-b0a83ae71b2588bd2a9e6b40f95191602940e01e.tar glibc-b0a83ae71b2588bd2a9e6b40f95191602940e01e.tar.gz glibc-b0a83ae71b2588bd2a9e6b40f95191602940e01e.tar.bz2 glibc-b0a83ae71b2588bd2a9e6b40f95191602940e01e.zip |
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
Diffstat (limited to 'login')
-rw-r--r-- | login/utmp_file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/login/utmp_file.c b/login/utmp_file.c index be7cc0671b..e627233478 100644 --- a/login/utmp_file.c +++ b/login/utmp_file.c @@ -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; |