From patchwork Thu Nov 7 09:00:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Adhemerval Zanella (Code Review)" X-Patchwork-Id: 1191001 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-106737-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gnutoolchain-gerrit.osci.io Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="UebWCyBA"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 477y7c5CNRz9sNx for ; Thu, 7 Nov 2019 20:01:32 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; q=dns; s=default; b=iuWO8UEiWqX0pE9s/nCeqvW+tjaPWL1 7FVlvE8EOPzOw6WhXiQy1oUUHsqT8bZKsC79mTREzsaL6CJ/kBDuB1ezR3ChAby5 sstTi9cuDcKdovm77CMBKTX/enXgs9JqCYZohaq5kY43rok9JCZ9UXJQ8tFbw6HC VssNbSUHjzVo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; s=default; bh=tSD5ArDlIOpIA8AFStmYFUZY4lg=; b=UebWC yBA/vTpnnwtetCPe3vLABfXud19yfEbCI5MOGyhB7++gvbFefkSV5LQ5ysvw5VHk xHTTEmgAqdaLNDc/2T/HIfWzVzbKiEVv/b15HXppCBFMfbsD1IomYStWSiY3ivwU wHc3paRI2nRJGH1MGjZH3cMHBBZzzAWw/x5cRw= Received: (qmail 43184 invoked by alias); 7 Nov 2019 09:01:08 -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 42985 invoked by uid 89); 7 Nov 2019 09:01:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=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:12 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Florian Weimer , libc-alpha@sourceware.org Cc: Carlos O'Donell Auto-Submitted: auto-generated X-Gerrit-MessageType: merged 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.8D5022816D@gnutoolchain-gerrit.osci.io> Sourceware to Gerrit sync has submitted this change. 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;