From patchwork Wed Aug 12 15:56:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 7002921 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7CC349F39D for ; Wed, 12 Aug 2015 16:03:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 36FAD205E7 for ; Wed, 12 Aug 2015 16:03:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82FCF205E3 for ; Wed, 12 Aug 2015 16:03:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753992AbbHLQDc (ORCPT ); Wed, 12 Aug 2015 12:03:32 -0400 Received: from guitar.tcltek.co.il ([192.115.133.116]:42160 "EHLO mx.tkos.co.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753525AbbHLQDb (ORCPT ); Wed, 12 Aug 2015 12:03:31 -0400 Received: from tarshish.tkos.co.il (unknown [10.0.8.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPSA id 9C01A440936; Wed, 12 Aug 2015 18:56:44 +0300 (IDT) From: Baruch Siach To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, Baruch Siach Subject: [PATCH] v4l2grab: print function name and ioctl number on failure Date: Wed, 12 Aug 2015 18:56:32 +0300 Message-Id: <3197193698388412798e8c81d8e30d9a393b670f.1439394992.git.baruch@tkos.co.il> X-Mailer: git-send-email 2.5.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This makes the failure error message a little more useful. Signed-off-by: Baruch Siach --- contrib/test/v4l2grab.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/test/v4l2grab.c b/contrib/test/v4l2grab.c index 3e1be3de6353..778c51cc391a 100644 --- a/contrib/test/v4l2grab.c +++ b/contrib/test/v4l2grab.c @@ -43,7 +43,8 @@ static void xioctl(int fh, unsigned long int request, void *arg) } while (r == -1 && ((errno == EINTR) || (errno == EAGAIN))); if (r == -1) { - fprintf(stderr, "error %d, %s\n", errno, strerror(errno)); + fprintf(stderr, "%s(%lu): error %d, %s\n", __func__, + _IOC_NR(request), errno, strerror(errno)); exit(EXIT_FAILURE); } }