From nobody Sun Feb 8 16:11:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576070580; cv=none; d=zohomail.com; s=zohoarc; b=acdg9jZazpaUr5U8qt1n2pxM9TTIEg9xGyvEC92bpqWQcoAPn55Qwn3XU0Gaz97yA4hYS6j3c+YsZ8go9L7GmEySES2UQI3aCUZiomoPWovHue6JQAwWGcodDX47NfWsPIQFYy1DkXZADCJZrDlj3kVVVXNz/g9N51vAGkXvGo0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576070580; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FkWA15Dm5QDYwRUX/1ZZG9ks8BmV1erLmOQathxacUM=; b=lFT/A7s40Go8BJDxAvhr/G9G1WxpRCB4ogbiusnoMU63Fw9ANanp+2hIq1jYJ+FN31oz0+ET33hZoJ/DYs6VGlinCnUsEzD0IKX5MXMKJREx7fEZX0D8i0YwPt2SrNjA3k9yp4QSlx9GFxnZ254QDT3sD/U26CwsXyn7JC3Pgu4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576070580626245.4019798149559; Wed, 11 Dec 2019 05:23:00 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-375-goT8m7jsO12wrEaFbefdCw-1; Wed, 11 Dec 2019 08:22:57 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E166800D4E; Wed, 11 Dec 2019 13:22:52 +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 37E9760BB5; Wed, 11 Dec 2019 13:22:52 +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 E39A7182B013; Wed, 11 Dec 2019 13:22:51 +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 xBBDMUYx019716 for ; Wed, 11 Dec 2019 08:22:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id 532F463BBA; Wed, 11 Dec 2019 13:22:30 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.43.2.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id D040C67583 for ; Wed, 11 Dec 2019 13:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576070579; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=FkWA15Dm5QDYwRUX/1ZZG9ks8BmV1erLmOQathxacUM=; b=PyjYcbWStDWLGda54hN9IbeAJXu0hC4EkgJ3KJNEDNcd4kD8co97D8rC8Agk05gEPBwxAv 3Ujbf2/ZQ5obc/+ZIQLc9fkxvTmVfS8vqqp8D0/tTWbPH1xU9p6HhbpRzNhSW2rlk7v7Q3 4tXoZfDB1h3rbPzYHYYo6MBw3DrvP84= From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 11 Dec 2019 14:23:18 +0100 Message-Id: <203a24db2480e67952beb845e42175c8df35112d.1576070578.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCHv2 2/8] vsh: remove vshErrorOOM 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: goT8m7jsO12wrEaFbefdCw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) We abort on allocation errors now so there is no need to have a function for it. Replace the only use by return -1, chosen by fair dice roll. Signed-off-by: J=C3=A1n Tomko --- tools/vsh.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 6c78a7a373..dd2c039b47 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -64,17 +64,6 @@ const vshCmdGrp *cmdGroups; const vshCmdDef *cmdSet; =20 =20 -/* simple handler for oom conditions */ -static void -vshErrorOOM(void) -{ - fflush(stdout); - fputs(_("error: Out of memory\n"), stderr); - fflush(stderr); - exit(EXIT_FAILURE); -} - - double vshPrettyCapacity(unsigned long long val, const char **unit) { @@ -361,7 +350,7 @@ vshCmddefCheckInternals(vshControl *ctl, } if ((p =3D strchr(name, '=3D')) && VIR_STRNDUP(name, name, p - name) < 0) - vshErrorOOM(); + return -1; for (j =3D i + 1; cmd->opts[j].name; j++) { if (STREQ(name, cmd->opts[j].name) && cmd->opts[j].type !=3D VSH_OT_ALIAS) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list