{"id":15150,"url":"https://patchwork.libcamera.org/api/1.1/patches/15150/?format=json","web_url":"https://patchwork.libcamera.org/patch/15150/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20211213145143.218734-2-jacopo@jmondi.org>","date":"2021-12-13T14:51:42","name":"[libcamera-devel,1/2] test: fence: Check write return value","commit_ref":"a3122eeceafae4f37346ec40f24d20706473e962","pull_url":null,"state":"accepted","archived":false,"hash":"bfc579254226f1a84db58aca8e9bb60c8ea5fbad","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15150/mbox/","series":[{"id":2840,"url":"https://patchwork.libcamera.org/api/1.1/series/2840/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2840","date":"2021-12-13T14:51:41","name":"test: fence: Fixes for the fence test","version":1,"mbox":"https://patchwork.libcamera.org/series/2840/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15150/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15150/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 7A646BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Dec 2021 14:50:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 42FF060897;\n\tMon, 13 Dec 2021 15:50:58 +0100 (CET)","from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7071D60868\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Dec 2021 15:50:54 +0100 (CET)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 0ED0460002;\n\tMon, 13 Dec 2021 14:50:53 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 13 Dec 2021 15:51:42 +0100","Message-Id":"<20211213145143.218734-2-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.33.1","In-Reply-To":"<20211213145143.218734-1-jacopo@jmondi.org>","References":"<20211213145143.218734-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/2] test: fence: Check write return value","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The ::write() function used to signal a framebuffer fence in the unit\ntest is marked with the 'warn_unused_result'.\n\nWhen building in debugoptimized mode not checking for the return\nvalue causes issues at build time:\n/test/fence.cpp:254:2: error: ignoring return value of function declared with 'warn_unused_result' attribute\n\nFix that by checking the ::write() return value and emitting an\nerror message in case the write fails.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n test/fence.cpp | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)","diff":"diff --git a/test/fence.cpp b/test/fence.cpp\nindex d2dfc9b615a9..d2865398784e 100644\n--- a/test/fence.cpp\n+++ b/test/fence.cpp\n@@ -251,7 +251,12 @@ void FenceTest::requestComplete(Request *request)\n void FenceTest::signalFence()\n {\n \tuint64_t value = 1;\n-\twrite(efd2_, &value, sizeof(value));\n+\tint ret;\n+\n+\tret = write(efd2_, &value, sizeof(value));\n+\tif (ret != sizeof(value))\n+\t\tcerr << \"Failed to signal fence\" << endl;\n+\n \tdispatcher_->processEvents();\n }\n \n","prefixes":["libcamera-devel","1/2"]}