From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMLJq-0002pD-2U for qemu-devel@nongnu.org; Tue, 26 Aug 2014 14:18:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMLJj-0000He-Kz for qemu-devel@nongnu.org; Tue, 26 Aug 2014 14:18:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMLJj-0000HY-D9 for qemu-devel@nongnu.org; Tue, 26 Aug 2014 14:18:03 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7QII2mf032170 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 26 Aug 2014 14:18:02 -0400 From: Stefan Hajnoczi Date: Tue, 26 Aug 2014 19:17:54 +0100 Message-Id: <1409077076-29855-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1409077076-29855-1-git-send-email-stefanha@redhat.com> References: <1409077076-29855-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 1/3] qemu-img: fix img_commit() error return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Jeff Cody , jsnow@redhat.com, Markus Armbruster , Stefan Hajnoczi The img_commit() return value is a process exit code. Use 1 for failure instead of -1. The other failure paths in this function already use 1. Signed-off-by: Stefan Hajnoczi --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index c843420..dc3adb5 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -771,7 +771,7 @@ static int img_commit(int argc, char **argv) ret = bdrv_parse_cache_flags(cache, &flags); if (ret < 0) { error_report("Invalid cache option: %s", cache); - return -1; + return 1; } bs = bdrv_new_open("image", filename, fmt, flags, true, quiet); -- 1.9.3