From patchwork Thu Nov 7 09:00:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 35714 Received: (qmail 55110 invoked by alias); 7 Nov 2019 09:06:04 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 55099 invoked by uid 89); 7 Nov 2019 09:06:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: mx1.osci.io X-Gerrit-PatchSet: 2 Date: Thu, 7 Nov 2019 04:00:11 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Florian Weimer , Carlos O'Donell , libc-alpha@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [pushed] login: Remove double-assignment of fl.l_whence in try_file_lock X-Gerrit-Change-Id: I2baf9e70690e723c61051b25ccbd510aec15976c X-Gerrit-Change-Number: 515 X-Gerrit-ChangeURL: X-Gerrit-Commit: b0a83ae71b2588bd2a9e6b40f95191602940e01e In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, fweimer@redhat.com, libc-alpha@sourceware.org, carlos@redhat.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-75-g9005159e5d Message-Id: <20191107090012.7E2D325B28@gnutoolchain-gerrit.osci.io> The original change was created by Florian Weimer. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/515 ...................................................................... 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 --- M login/utmp_file.c 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/login/utmp_file.c b/login/utmp_file.c index be7cc06..e627233 100644 --- a/login/utmp_file.c +++ b/login/utmp_file.c @@ -79,7 +79,7 @@ struct flock64 fl = { .l_type = type, - fl.l_whence = SEEK_SET, + .l_whence = SEEK_SET, }; bool status = __fcntl64_nocancel (fd, F_SETLKW, &fl) < 0;