Show a patch.

GET /api/patches/18380/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 18380,
    "url": "https://patchwork.libcamera.org/api/patches/18380/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18380/",
    "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": "<20230311190526.17104-1-mail@eliasnaur.com>",
    "date": "2023-03-11T19:05:25",
    "name": "[libcamera-devel] libcamera: v4l2_device: openat(2) with O_CLOEXEC to cleanup after exec(3)",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "cc2ce6078581aceb4e0bbcea1b7bb9d19b379dd6",
    "submitter": {
        "id": 159,
        "url": "https://patchwork.libcamera.org/api/people/159/?format=api",
        "name": "Elias Naur",
        "email": "mail@eliasnaur.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18380/mbox/",
    "series": [
        {
            "id": 3800,
            "url": "https://patchwork.libcamera.org/api/series/3800/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3800",
            "date": "2023-03-11T19:05:25",
            "name": "[libcamera-devel] libcamera: v4l2_device: openat(2) with O_CLOEXEC to cleanup after exec(3)",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3800/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18380/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18380/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 14777BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 11 Mar 2023 20:02:37 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 832F5626D6;\n\tSat, 11 Mar 2023 21:02:36 +0100 (CET)",
            "from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com\n\t[IPv6:2607:f8b0:4864:20::e2e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0289761ED5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 Mar 2023 20:05:40 +0100 (CET)",
            "by mail-vs1-xe2e.google.com with SMTP id d20so7628745vsf.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 Mar 2023 11:05:40 -0800 (PST)",
            "from localhost.localdomain ([190.53.0.133])\n\tby smtp.gmail.com with ESMTPSA id\n\ts18-20020a05610201d200b004122a65ee17sm304032vsq.21.2023.03.11.11.05.38\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 11 Mar 2023 11:05:39 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678564956;\n\tbh=E1PxUu2w+skXAgnuNDA0mBtPYPNSegr2JU9taNinm7Q=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=fmvSvXxIGGNmoYYIkZ/9f940vDEFCaa0lnTVw0cysPPyr3OnRBfkAYauMQfQP8VY1\n\tRpLYGIOwQYtsm375TGqY+L+OZonenM3GAEOla4w4iOazuYMA6jrK9Pg2o9vToB1kUS\n\t6K4TrTUce6HUMU7t7MnA8lhU/oq8S0bitudqKQC1H2OQvggAvGv+PvUtRQrQYCLkAX\n\taRmsJIaGS3msCpMRFy48I3g3V9LhNYMviBoRVyYY2vAj4ACvoM3LN90Jq8kPJzXad9\n\tNapu6/nNYU+8iHR/XpfvCQIWB/RiHDKodJ8i/w9x7lb6Q1HNTLfERA6k4T/sjG40bL\n\t8mAp0tgHKICMQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=eliasnaur.com; s=google; t=1678561539;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=vS7wbTXk7KoExEUsDUdKHOzhATj80NAZyJYhWuKhuEM=;\n\tb=rxmFVfaKhmxRxPBJEBoNERBQHu10VnAAC/vOV4BSn/hk9yauQGhp/ACmMoLdwBUjjv\n\tJO/t4oWjtfHcJ2PT0wAZtnBC/p+U94Q6RU8rgFUgSzhxzQm2+cyQzhQpkIv+Bz025H5b\n\t9ndLsSE2zU5xoHN1VVM7ojPaL3+j0yKweSyPv9dDrgafuxxn+l6zoKSdHPAxfcbn2TNf\n\t8O2QsaG/0vu1LSzg/sBqHJ69PEcCzXHJ4+tW1tMd9rN8axnItQxLlyAJvlcCCKaPiuLE\n\tcLgKlMIZ6sKyFv2OYHwFqgKsbjETTyOdq3uudnMrsPrgVDjI5SvA0R/KZg31ZvswlfDB\n\tDc0A=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=eliasnaur.com\n\theader.i=@eliasnaur.com\n\theader.b=\"rxmFVfaK\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112; t=1678561539;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=vS7wbTXk7KoExEUsDUdKHOzhATj80NAZyJYhWuKhuEM=;\n\tb=ZOcY2XB4x+dg04VEeRcSj8YJy00qzTtjw+bWMlsbyWNNY90M2APlbc0Xs7GRMMxtVK\n\tfo1mD8JhwiHnKet7vfAPyQAGa0GfXb1F+dBBHnED/GQeuJEv4s7OcFBTHTlt87f6wQtK\n\tjMqNzgNzkmZrXGwPbe+ew+TeRCtZ+O9Rzd5I8RuNxzJPXQUuy5+MiAKhQIMwrp0lFxPq\n\txFYqE9PgDu7hop9Ny8L7SmYkUFhIdsAUZBMxA3lIIrzhTdQcZAhSNHhw8qiU/K9UpnCV\n\tlyG0WDSL3Q9EpIdbotqw4PyCyLD5KhtEePgoTTEk+nbpghoZTTnneCvsBI39Xzuwrnys\n\tcNUQ==",
        "X-Gm-Message-State": "AO0yUKWSN6ArGnM4lRIUbqJTFbJoVp356XShdztfK8Ktmkb5w809pNGz\n\tl5K5H1cnvEPNvm6lTxXaU4F3BGr8gSO16qyYVNk=",
        "X-Google-Smtp-Source": "AK7set+zHKnXX30zOrB9Wjb+V8/b0MpUPc57FUWfgHVTsh99nMLYyY6iopbJvx694eqvupoHD36JxQ==",
        "X-Received": "by 2002:a67:ffc1:0:b0:412:220e:369c with SMTP id\n\tw1-20020a67ffc1000000b00412220e369cmr16065321vsq.21.1678561539482; \n\tSat, 11 Mar 2023 11:05:39 -0800 (PST)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat, 11 Mar 2023 13:05:25 -0600",
        "Message-Id": "<20230311190526.17104-1-mail@eliasnaur.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Approved-At": "Sat, 11 Mar 2023 21:02:35 +0100",
        "Subject": "[libcamera-devel] [PATCH] libcamera: v4l2_device: openat(2) with\n\tO_CLOEXEC to cleanup after exec(3)",
        "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>",
        "From": "Elias Naur via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Elias Naur <mail@eliasnaur.com>",
        "Cc": "Elias Naur <mail@eliasnaur.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "It's generally a good idea to openat(2) with O_CLOEXEC, but this patch\nalso fixes a problem where the v4l2 devices would report -EBUSY after\nan exec(3).\n\nSigned-off-by: Elias Naur <mail@eliasnaur.com>\n---\n src/libcamera/v4l2_device.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)",
    "diff": "diff --git src/libcamera/v4l2_device.cpp src/libcamera/v4l2_device.cpp\nindex 57a88d96..ad9d1e37 100644\n--- src/libcamera/v4l2_device.cpp\n+++ src/libcamera/v4l2_device.cpp\n@@ -86,7 +86,7 @@ int V4L2Device::open(unsigned int flags)\n \t\treturn -EBUSY;\n \t}\n \n-\tUniqueFD fd(syscall(SYS_openat, AT_FDCWD, deviceNode_.c_str(), flags));\n+\tUniqueFD fd(syscall(SYS_openat, AT_FDCWD, deviceNode_.c_str(), flags|O_CLOEXEC));\n \tif (!fd.isValid()) {\n \t\tint ret = -errno;\n \t\tLOG(V4L2, Error) << \"Failed to open V4L2 device '\"\n",
    "prefixes": [
        "libcamera-devel"
    ]
}