From patchwork Wed Nov 6 21:54:52 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: 1190719 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-106719-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="AueE6LzY"; 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 477gLc21p8z9sNT for ; Thu, 7 Nov 2019 08:55:03 +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:message-id:subject:references :reply-to:mime-version:content-transfer-encoding:content-type; q=dns; s=default; b=SIbFO18ee7O28vLg8cBqidhWprTJB0c3tX4n+hy6ebw 2LqU6Z5JycYbPku/7/a3mdrIvkJKy1ugLfawxo1SlEfpN6tIXR+dPxLe3EIYayTk PVzxgFVuosLkfrjJrgPLs5LuTU5aN+MZyBKwhUg/vUh2MdjKLE7YH+Yi2GM6mNHQ = 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:message-id:subject:references :reply-to:mime-version:content-transfer-encoding:content-type; s=default; bh=40/EdGBVzan6I3GjIhvVcCEqgbo=; b=AueE6LzYXZZg39SbW 4E0dIA09axrjbCykcO6pd20X5e1Q88jnYoZtJp69Ixr2SfDZJni1Z9lurZaTLt+w lXnGtH4QPdlJLJ+4P76UZhbNihvHRgiTyrIflbi4SfTsNC4lumH2fx+lE7DvdVTN Szb7BSbHLXQEwONkkHkbqXSLzA= Received: (qmail 63111 invoked by alias); 6 Nov 2019 21:54:57 -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 63101 invoked by uid 89); 6 Nov 2019 21:54:56 -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=HContent-Transfer-Encoding:8bit X-HELO: mx1.osci.io X-Gerrit-PatchSet: 1 Date: Wed, 6 Nov 2019 16:54:52 -0500 From: "Florian Weimer (Code Review)" To: libc-alpha@sourceware.org Cc: Florian Weimer Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] 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: 2741b1f25a51597995b861e00ca5a76cade297f5 References: Reply-To: fweimer@redhat.com, fweimer@redhat.com, libc-alpha@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-75-g9005159e5d 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. Change-Id: I2baf9e70690e723c61051b25ccbd510aec15976c Reviewed-by: Carlos O'Donell --- 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;