From patchwork Fri Feb 9 15:25:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 85529 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 158AC3858022 for ; Fri, 9 Feb 2024 15:26:43 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id ED6383858014 for ; Fri, 9 Feb 2024 15:25:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED6383858014 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ED6383858014 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707492319; cv=none; b=UMob6gz2AgjxLwk6+C+YLxIktFJTWADoRm60XL1FdkhrH3bSJiTYItmKz9TJwg7IGVBXBBdZqJJtUhgx3rIspJkkNjika4LP3qgsVfEf4MYrDX8kuk3dESGe7VKgYlO5kgdwm/3D/nciMWK90UPsNotf2p96TWsM/UHm09DsymY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707492319; c=relaxed/simple; bh=9FvvSzgWAMVSuymzi8d16HxTp53gFWlDHQL5enAi0dE=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=s51It5nyFZghL8rIWjFRDl2SWnM4NTumKKi76g6EKO/V96z7kMUCFCyhGc8l5BC2U/oxEIqcRdJhbLiKW8ntGHYkHxHhnK5qJoowG2VfHup3GSx8ok75DTfLHdWKa3Op9ZjY8RFajukW2MygsOSua6RL22GLOs2d5auiTFVTLp0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707492317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jxonwt4NHHJXGEuHnhbvhj4kYhoREmBC2PCKbvzMsZc=; b=cZ83R0pXHDW/QGgw0Dd85TLqECJZOZ0oIPAOzhHJBkQGT24Uwepe51Z9TOncIRy+6SdBS+ YPb4kGJyKhxI5+Aaoernm+GM12e3qarSHQK3zwZTef6bL682LExkfRRbUAt1m6K70n7Xz8 Wz/mzQMy2aCQl6l6qAQi/2UEbH2C+o4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-44--MDeuozzO2m0gu4c_k5MvQ-1; Fri, 09 Feb 2024 10:25:16 -0500 X-MC-Unique: -MDeuozzO2m0gu4c_k5MvQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D49E38F4768 for ; Fri, 9 Feb 2024 15:25:15 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A4C711217 for ; Fri, 9 Feb 2024 15:25:15 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 04/11] syslog: Update misc/tst-syslog to check reported %n value In-Reply-To: Message-ID: <8502804480ab69e7ae48dfe43552e9a6be596711.1707491940.git.fweimer@redhat.com> References: X-From-Line: 8502804480ab69e7ae48dfe43552e9a6be596711 Mon Sep 17 00:00:00 2001 Date: Fri, 09 Feb 2024 16:25:13 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org --- misc/tst-syslog.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/misc/tst-syslog.c b/misc/tst-syslog.c index ced9ae8467..741693a7ff 100644 --- a/misc/tst-syslog.c +++ b/misc/tst-syslog.c @@ -102,8 +102,10 @@ send_vsyslog (int options) { int facility = facilities[i]; int priority = priorities[j]; - call_vsyslog (facility | priority, "%s %d %d", SYSLOG_MSG_BASE, - facility, priority); + int pos = -1; + call_vsyslog (facility | priority, "%n%s %d %d", + &pos, SYSLOG_MSG_BASE, facility, priority); + TEST_COMPARE (pos, 0); } } } @@ -117,8 +119,10 @@ send_syslog (int options) { int facility = facilities[i]; int priority = priorities[j]; - syslog (facility | priority, "%s %d %d", SYSLOG_MSG_BASE, facility, - priority); + int pos = -1; + syslog (facility | priority, "%n%s %d %d", + &pos, SYSLOG_MSG_BASE, facility, priority); + TEST_COMPARE (pos, 0); } } }