Patch Detail
Show a patch.
GET /api/1.1/patches/3468/?format=api
{ "id": 3468, "url": "https://patchwork.libcamera.org/api/1.1/patches/3468/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3468/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20200415150409.27938-2-email@uajain.com>", "date": "2020-04-15T15:04:14", "name": "[libcamera-devel,v2,1/2] test: ipc: unixsocket: Close open fds on error paths", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "0605d9d5871cdfda451adfa38da18e1902bcef01", "submitter": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/people/1/?format=api", "name": "Umang Jain", "email": "email@uajain.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/3468/mbox/", "series": [ { "id": 811, "url": "https://patchwork.libcamera.org/api/1.1/series/811/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=811", "date": "2020-04-15T15:04:13", "name": "Coverity scans fixes", "version": 2, "mbox": "https://patchwork.libcamera.org/series/811/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/3468/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3468/checks/", "tags": {}, "headers": { "Return-Path": "<bounces+15657259-5c31-libcamera-devel=lists.libcamera.org@em7280.uajain.com>", "Received": [ "from o1.f.az.sendgrid.net (o1.f.az.sendgrid.net [208.117.55.132])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D7A6D62E35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Apr 2020 17:04:15 +0200 (CEST)", "by filterdrecv-p3iad2-8ddf98858-4rnwn with SMTP id\n\tfilterdrecv-p3iad2-8ddf98858-4rnwn-19-5E97226E-11\n\t2020-04-15 15:04:14.332166651 +0000 UTC m=+1778209.186877990", "from mail.uajain.com (unknown)\n\tby ismtpd0003p1maa1.sendgrid.net (SG) with ESMTP\n\tid qiH5KXC1QbibuDzsa_54lQ Wed, 15 Apr 2020 15:04:13.927 +0000 (UTC)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=uajain.com\n\theader.i=@uajain.com header.b=\"FMA4ts4p\"; \n\tdkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=uajain.com;\n\th=from:subject:in-reply-to:references:mime-version:to:cc:\n\tcontent-transfer-encoding:content-type;\n\ts=s1; bh=igqKtmU9R/gVFk9I7l20auMWyLmlsLFGtzLi0TNLEnk=;\n\tb=FMA4ts4pNWyS3gannIz5Y9tZUHBrEyBzWGU55qrbCsDRGQyyYftWYmdsmnYqozWs39CF\n\tEtnYnc4fLiZijQOg/lqj8cBVRIa0IAScyXigTW7ZhFPALVencKsmRZlbTobVQNMJdtuvsg\n\tFfmv8cWSLUO2t0MthW0lUI4HDUsguPjbY=", "From": "Umang Jain <email@uajain.com>", "Date": "Wed, 15 Apr 2020 15:04:14 +0000 (UTC)", "Message-Id": "<20200415150409.27938-2-email@uajain.com>", "In-Reply-To": "<20200415150409.27938-1-email@uajain.com>", "References": "<20200415150409.27938-1-email@uajain.com>", "Mime-Version": "1.0", "X-SG-EID": "1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPc4om/Oij3lMEQBxKPi/30O4MUN2cHtcUTKTK91M24p1f7vvUOd0VY77AWX2BK8X3j0dlslJ53foXH1NojjJYnYUus+UEc7JW28mLxJZC4V6OeaKeoUZEpPRLF5qSJdQonsu+/7zl5YTs8H7F/+fQ32eaGryCU7nvfjJ55BT+VVfdT6mHUywRByTbtlUcfjms3tR1j9JzDbUmkHxv/gYLCkA==", "To": "libcamera-devel@lists.libcamera.org", "Content-Transfer-Encoding": "7bit", "Content-Type": "text/plain; charset=us-ascii", "Subject": "[libcamera-devel] [PATCH v2 1/2] test: ipc: unixsocket: Close open\n\tfds on error paths", "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": "Wed, 15 Apr 2020 15:04:16 -0000" }, "content": "Pointed out by Coverity DefectId=279052\n\nSigned-off-by: Umang Jain <email@uajain.com>\n---\n test/ipc/unixsocket.cpp | 19 ++++++++++++-------\n 1 file changed, 12 insertions(+), 7 deletions(-)", "diff": "diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp\nindex 5348f35..7bc6a89 100644\n--- a/test/ipc/unixsocket.cpp\n+++ b/test/ipc/unixsocket.cpp\n@@ -16,6 +16,7 @@\n #include <unistd.h>\n \n #include <libcamera/event_dispatcher.h>\n+#include <libcamera/file_descriptor.h>\n #include <libcamera/timer.h>\n \n #include \"ipc_unixsocket.h\"\n@@ -467,18 +468,22 @@ private:\n \t\tif (fd < 0)\n \t\t\treturn fd;\n \n+\t\tFileDescriptor file_desc = FileDescriptor(fd);\n+\t\tclose(fd);\n+\t\tif (file_desc.fd() < 0)\n+\t\t\treturn file_desc.fd();\n+\n \t\tint size = 0;\n \t\tfor (unsigned int i = 0; i < num; i++) {\n-\t\t\tint clone = dup(fd);\n-\t\t\tif (clone < 0)\n-\t\t\t\treturn clone;\n+\t\t\tFileDescriptor *clone = new FileDescriptor(file_desc.fd());\n+\t\t\tint clone_int = clone->fd();\n+\t\t\tif (clone_int < 0)\n+\t\t\t\treturn clone_int;\n \n-\t\t\tsize += calculateLength(clone);\n-\t\t\tmessage->fds.push_back(clone);\n+\t\t\tsize += calculateLength(clone_int);\n+\t\t\tmessage->fds.push_back(clone_int);\n \t\t}\n \n-\t\tclose(fd);\n-\n \t\treturn size;\n \t}\n \n", "prefixes": [ "libcamera-devel", "v2", "1/2" ] }