From nobody Sat Sep 21 00:58:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1550588832137857.7292450230335; Tue, 19 Feb 2019 07:07:12 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 366DBC059B7A; Tue, 19 Feb 2019 15:07:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F1E4560F94; Tue, 19 Feb 2019 15:07:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8D992181A00B; Tue, 19 Feb 2019 15:07:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1JF758o012999 for ; Tue, 19 Feb 2019 10:07:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id 84C925D70E; Tue, 19 Feb 2019 15:07:05 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0919E5D717 for ; Tue, 19 Feb 2019 15:07:02 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 19 Feb 2019 16:07:01 +0100 Message-Id: <20190219150701.7884-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] iohelper: Remove remaining newlines from error messages X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 19 Feb 2019 15:07:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The iohelper is an internal program that's only supposed to be called by libvirt, and whatever output it might produce will ultimately be passed to virReportError() or similar. Since we do not want strings passed to those functions to contain newlines, we can simply not output them in the first place. This is what happens in pretty much all cases already, but in a couple instances newlines have managed to slip in. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump --- src/util/iohelper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/iohelper.c b/src/util/iohelper.c index aed7ef3184..ddc338b7c7 100644 --- a/src/util/iohelper.c +++ b/src/util/iohelper.c @@ -181,7 +181,7 @@ usage(int status) if (status) { fprintf(stderr, _("%s: try --help for more details"), program_name= ); } else { - printf(_("Usage: %s FILENAME FD\n"), program_name); + printf(_("Usage: %s FILENAME FD"), program_name); } exit(status); } @@ -198,7 +198,7 @@ main(int argc, char **argv) if (virGettextInitialize() < 0 || virThreadInitialize() < 0 || virErrorInitialize() < 0) { - fprintf(stderr, _("%s: initialization failed\n"), program_name); + fprintf(stderr, _("%s: initialization failed"), program_name); exit(EXIT_FAILURE); } =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list