[{"id":4974,"web_url":"https://patchwork.libcamera.org/comment/4974/","msgid":"<20200602204104.GC6547@pendragon.ideasonboard.com>","date":"2020-06-02T20:41:04","subject":"Re: [libcamera-devel] [PATCH] libcamera: test: Fixed the\n\tcompilation issue","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Madhavan,\n\nThank you for the patch.\n\nNo need to prefix the subject line with 'libcamera:' for the tests.\n\nOn Tue, Jun 02, 2020 at 10:36:34PM +0200, Madhavan Krishnan wrote:\n> The return value of write() function is ignored, causing the following\n> compiler error|warning with gcc version 5.4\n> \n> error: ignoring return value of 'ssize_t write(int, const void*, size_t)'\n> \n> Fix this by storing the return value of write() and return a test error in\n> case of failure.\n> \n> Reported-by: Coverity CID=284605\n> \n> Signed-off-by: Madhavan Krishnan <madhavan.krishnan@linaro.org>\n> ---\n>  test/file.cpp | 7 +++++--\n>  1 file changed, 5 insertions(+), 2 deletions(-)\n> \n> diff --git a/test/file.cpp b/test/file.cpp\n> index 6262a6f..e328c01 100644\n> --- a/test/file.cpp\n> +++ b/test/file.cpp\n> @@ -27,13 +27,16 @@ protected:\n>  \t{\n>  \t\tfileName_ = \"/tmp/libcamera.test.XXXXXX\";\n>  \t\tint fd = mkstemp(&fileName_.front());\n> +\t\tssize_t ret;\n> +\n>  \t\tif (fd == -1)\n>  \t\t\treturn TestFail;\n>  \n> -\t\twrite(fd, \"libcamera\", 9);\n> +\t\tret = write(fd, \"libcamera\", 9);\n\nYou can declare the ret variable on the same line.\n\n> +\n>  \t\tclose(fd);\n>  \n> -\t\treturn TestPass;\n> +\t\treturn ret == 9? TestPass : TestFail;\n\nMissing space after 9. I'll fix when applying,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \t}\n>  \n>  \tint run()","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 212BA603D0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  2 Jun 2020 22:41:20 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8FAD82A4;\n\tTue,  2 Jun 2020 22:41:19 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"rXpA9v3z\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1591130479;\n\tbh=o9/31k7Gr6pMn6I9sS+n0ddlxZL1tIOeqtTU61nR7FU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=rXpA9v3zwx4S7j7h2ROEJasyGi7wB/nwyn0+JrasAHDhm+opfZPBz7K6mNYoWfzmB\n\tTCntPTDGchHUckCGFwaAdl5NyEOdVjdxe1E04oQDZy8o8P4LyJNkjYZ9lnBstJrqOs\n\tPJdIySQV82JwZIQMGhyBJ757g9qMAt6F98o5rRa0=","Date":"Tue, 2 Jun 2020 23:41:04 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Madhavan Krishnan <madhavan.krishnan@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200602204104.GC6547@pendragon.ideasonboard.com>","References":"<1591130194-5161-1-git-send-email-madhavan.krishnan@linaro.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<1591130194-5161-1-git-send-email-madhavan.krishnan@linaro.org>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: test: Fixed the\n\tcompilation issue","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>","X-List-Received-Date":"Tue, 02 Jun 2020 20:41:20 -0000"}}]