Patch Detail
Show a patch.
GET /api/patches/14821/?format=api
{ "id": 14821, "url": "https://patchwork.libcamera.org/api/patches/14821/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14821/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20211128235752.10836-7-laurent.pinchart@ideasonboard.com>", "date": "2021-11-28T23:57:41", "name": "[libcamera-devel,v3,06/17] libcamera: base: file_descriptor: Add constructor from UniqueFD", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "15714b62a076e77db0d2fdc4d88057e57b0c10a8", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14821/mbox/", "series": [ { "id": 2768, "url": "https://patchwork.libcamera.org/api/series/2768/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2768", "date": "2021-11-28T23:57:35", "name": "libcamera: Introduce UniqueFD", "version": 3, "mbox": "https://patchwork.libcamera.org/series/2768/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14821/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14821/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 810C2C324F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Nov 2021 23:58:31 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 46C63605A5;\n\tMon, 29 Nov 2021 00:58:30 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EA3CE6057D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Nov 2021 00:58:23 +0100 (CET)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8388BA15;\n\tMon, 29 Nov 2021 00:58:23 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"bkyKTJqr\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638143903;\n\tbh=DunH+O3Etm9haLA0VlTo9xZbonfp9MEcsbPRg1t21NY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=bkyKTJqr194sYU+NWjCB1ghK5Gv3e+kgNF6sxabNPeucBZVks28WwI+x8GpRiKmgh\n\tpAnhK6lNu9rMmhKTjVuDqmoYiGCHJaLXQ1IAGQuSxtpBaxqFCnkMKZiY6KI2WclsR0\n\t/yAoDXkANoCwT/B0zIJreIWRCmJxzwgBEX1XUVgQ=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 29 Nov 2021 01:57:41 +0200", "Message-Id": "<20211128235752.10836-7-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.32.0", "In-Reply-To": "<20211128235752.10836-1-laurent.pinchart@ideasonboard.com>", "References": "<20211128235752.10836-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 06/17] libcamera: base:\n\tfile_descriptor: Add constructor from UniqueFD", "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": "From: Hirokazu Honda <hiroh@chromium.org>\n\nAdd a FileDescriptor constructor that takes a UniqueFD, transfering\nownership of the file descriptor to the FileDescriptor.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\nChanges since v2:\n\n- Pass UniqueFD by value\n---\n include/libcamera/base/file_descriptor.h | 3 +++\n src/libcamera/base/file_descriptor.cpp | 13 +++++++++++++\n 2 files changed, 16 insertions(+)", "diff": "diff --git a/include/libcamera/base/file_descriptor.h b/include/libcamera/base/file_descriptor.h\nindex 5d1594e80801..74292eba04f5 100644\n--- a/include/libcamera/base/file_descriptor.h\n+++ b/include/libcamera/base/file_descriptor.h\n@@ -11,11 +11,14 @@\n \n namespace libcamera {\n \n+class UniqueFD;\n+\n class FileDescriptor final\n {\n public:\n \texplicit FileDescriptor(const int &fd = -1);\n \texplicit FileDescriptor(int &&fd);\n+\texplicit FileDescriptor(UniqueFD fd);\n \tFileDescriptor(const FileDescriptor &other);\n \tFileDescriptor(FileDescriptor &&other);\n \t~FileDescriptor();\ndiff --git a/src/libcamera/base/file_descriptor.cpp b/src/libcamera/base/file_descriptor.cpp\nindex 98d4b4bfd24f..da696b2501cd 100644\n--- a/src/libcamera/base/file_descriptor.cpp\n+++ b/src/libcamera/base/file_descriptor.cpp\n@@ -13,6 +13,7 @@\n #include <utility>\n \n #include <libcamera/base/log.h>\n+#include <libcamera/base/unique_fd.h>\n \n /**\n * \\file base/file_descriptor.h\n@@ -109,6 +110,18 @@ FileDescriptor::FileDescriptor(int &&fd)\n \tfd = -1;\n }\n \n+/**\n+ * \\brief Create a FileDescriptor taking ownership of a given UniqueFD \\a fd\n+ * \\param[in] fd UniqueFD\n+ *\n+ * Construct a FileDescriptor from UniqueFD by taking ownership of the \\a fd.\n+ * The original \\a fd becomes invalid.\n+ */\n+FileDescriptor::FileDescriptor(UniqueFD fd)\n+\t: FileDescriptor(fd.release())\n+{\n+}\n+\n /**\n * \\brief Copy constructor, create a FileDescriptor from a copy of \\a other\n * \\param[in] other The other FileDescriptor\n", "prefixes": [ "libcamera-devel", "v3", "06/17" ] }