Patch Detail
Show a patch.
GET /api/1.1/patches/1379/?format=api
{ "id": 1379, "url": "https://patchwork.libcamera.org/api/1.1/patches/1379/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1379/", "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": "<20190610114936.30175-1-niklas.soderlund@ragnatech.se>", "date": "2019-06-10T11:49:36", "name": "[libcamera-devel] cam: Fix cam --help crash", "commit_ref": "238919be5949a0bc632920cbd5b58cc4a5ca4678", "pull_url": null, "state": "accepted", "archived": false, "hash": "698edac6a2824caeffcc092c0c776c4fa21b9038", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/1379/mbox/", "series": [ { "id": 342, "url": "https://patchwork.libcamera.org/api/1.1/series/342/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=342", "date": "2019-06-10T11:49:36", "name": "[libcamera-devel] cam: Fix cam --help crash", "version": 1, "mbox": "https://patchwork.libcamera.org/series/342/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1379/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1379/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A344B63347\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 Jun 2019 13:50:17 +0200 (CEST)", "from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid d37b02c2-8b75-11e9-8601-0050569116f7;\n\tMon, 10 Jun 2019 13:49:42 +0200 (CEST)" ], "X-Halon-ID": "d37b02c2-8b75-11e9-8601-0050569116f7", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 10 Jun 2019 13:49:36 +0200", "Message-Id": "<20190610114936.30175-1-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.21.0", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] cam: Fix cam --help crash", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "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": "Mon, 10 Jun 2019 11:50:17 -0000" }, "content": "The cam utility do not terminate correctly if invoked with only --help.\nIt prints the help information and then segfaults as the application is\nnot terminated correctly. Fix this by moving the return code check of\nthe option parsing to main().\n\nReported-by: Emmanuel Arias <eamanu@eamanu.com>\nSuggested-by: Jacopo Mondi <jacopo@jmondi.org>\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/cam/main.cpp | 8 +++++---\n 1 file changed, 5 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/cam/main.cpp b/src/cam/main.cpp\nindex dbf04917bcc5aa38..f03a9faf87fac865 100644\n--- a/src/cam/main.cpp\n+++ b/src/cam/main.cpp\n@@ -61,7 +61,7 @@ int CamApp::init(int argc, char **argv)\n \n \tret = parseOptions(argc, argv);\n \tif (ret < 0)\n-\t\treturn ret == -EINTR ? 0 : ret;\n+\t\treturn ret;\n \n \tcm_ = CameraManager::instance();\n \n@@ -193,9 +193,11 @@ void signalHandler(int signal)\n int main(int argc, char **argv)\n {\n \tCamApp app;\n+\tint ret;\n \n-\tif (app.init(argc, argv))\n-\t\treturn EXIT_FAILURE;\n+\tret = app.init(argc, argv);\n+\tif (ret)\n+\t\treturn ret == -EINTR ? 0 : EXIT_FAILURE;\n \n \tstruct sigaction sa = {};\n \tsa.sa_handler = &signalHandler;\n", "prefixes": [ "libcamera-devel" ] }