From: Florian Weimer Date: Thu, 7 Nov 2019 08:53:41 +0000 (+0100) Subject: login: Remove double-assignment of fl.l_whence in try_file_lock X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=143cea84a0e23d5ba0f4e9679f59f72763b46d27;p=thirdparty%2Fglibc.git 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 Change-Id: I2baf9e70690e723c61051b25ccbd510aec15976c (cherry picked from commit b0a83ae71b2588bd2a9e6b40f95191602940e01e) --- diff --git a/login/utmp_file.c b/login/utmp_file.c index 2d0548f6fa2..74ec622e96a 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;