get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 814236,
    "url": "http://patchwork.ozlabs.org/api/patches/814236/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/swupdate/patch/20170915114030.25138-1-christian.storm@siemens.com/",
    "project": {
        "id": 58,
        "url": "http://patchwork.ozlabs.org/api/projects/58/?format=api",
        "name": "swupdate development",
        "link_name": "swupdate",
        "list_id": "swupdate.googlegroups.com",
        "list_email": "swupdate@googlegroups.com",
        "web_url": "https://github.com/sbabic/swupdate",
        "scm_url": "git://github.com/sbabic/swupdate",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170915114030.25138-1-christian.storm@siemens.com>",
    "list_archive_url": null,
    "date": "2017-09-15T11:40:30",
    "name": "core: unlink socket files on normal termination",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9d1b69ad5af956bc981f7ef24161a13718eeb9a9",
    "submitter": {
        "id": 72180,
        "url": "http://patchwork.ozlabs.org/api/people/72180/?format=api",
        "name": "Storm, Christian",
        "email": "christian.storm@siemens.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/swupdate/patch/20170915114030.25138-1-christian.storm@siemens.com/mbox/",
    "series": [
        {
            "id": 3288,
            "url": "http://patchwork.ozlabs.org/api/series/3288/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/swupdate/list/?series=3288",
            "date": "2017-09-15T11:40:30",
            "name": "core: unlink socket files on normal termination",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/3288/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/814236/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/814236/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<swupdate+bncBDD6BWV65QPBBVPZ53GQKGQEJI2GGBQ@googlegroups.com>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=googlegroups.com\n\t(client-ip=2a00:1450:400c:c0c::239;\n\thelo=mail-wr0-x239.google.com;\n\tenvelope-from=swupdate+bncbdd6bwv65qpbbvpz53gqkgqeji2ggbq@googlegroups.com;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=googlegroups.com header.i=@googlegroups.com\n\theader.b=\"WRypK0n8\"; dkim-atps=neutral"
        ],
        "Received": [
            "from mail-wr0-x239.google.com (mail-wr0-x239.google.com\n\t[IPv6:2a00:1450:400c:c0c::239])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xttnj1Jqwz9s0g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 21:43:20 +1000 (AEST)",
            "by mail-wr0-x239.google.com with SMTP id 45sf211302wry.21\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 04:43:20 -0700 (PDT)",
            "by 10.28.161.4 with SMTP id k4ls280439wme.7.gmail; Fri, 15 Sep 2017\n\t04:43:17 -0700 (PDT)",
            "from david.siemens.de (david.siemens.de. [192.35.17.14])\n\tby gmr-mx.google.com with ESMTPS id\n\tc142si236593wmh.3.2017.09.15.04.43.17\n\tfor <swupdate@googlegroups.com>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 15 Sep 2017 04:43:17 -0700 (PDT)",
            "from mail3.siemens.de (mail3.siemens.de [139.25.208.14])\n\tby david.siemens.de (8.15.2/8.15.2) with ESMTPS id v8FBhGOA002795\n\t(version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)\n\tfor <swupdate@googlegroups.com>; Fri, 15 Sep 2017 13:43:16 +0200",
            "from MD1KR9XC.ad001.siemens.net ([139.25.69.251])\n\tby mail3.siemens.de (8.15.2/8.15.2) with ESMTP id v8FBhGNr011877;\n\tFri, 15 Sep 2017 13:43:16 +0200"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; t=1505475797; cv=pass;\n\td=google.com; s=arc-20160816;\n\tb=j5R3EyhZYNIqyUJs8Y3Vm1xyfgPfle0W008/toH59E7aqpSVM/XyILS5FntwK1I2cW\n\tFpII/TGT2/yR2Wl0nF0z3krMr48iVwo4B/KreXMfj3hvYsZtCMOcn/63COTLZb5CN8Q4\n\tPWa9YnvYLW2wsc9UuCfoJZ1NURyPQy6+qAWVzAU0H9zNXYJu7bZQPbJQexXl3qYqacd1\n\tCgiYZrzRR5MSP04CF7JySSYS1Te0ymUiHvbMo6t06fsrzJ7LJkgorbzWsWSKU26t7ZLQ\n\tOdOX+uSysooP+hhUqrW2Hx7CSYIa8BjJeMTKscrB2xepK/olNVSi1Lthqes55qW/Lw0U\n\tBBGQ==",
            "i=1; a=rsa-sha256; t=1505475797; cv=none;\n\td=google.com; s=arc-20160816;\n\tb=YcrVTG+pCh78hwGI1ZQFk4txuizDEybdIO+0aScQUbDSf7mnuLyd97q5xklOAnMjWt\n\t22mG0gqW8rwmJb0CSQOet51i+05+6H7HlRsXLdcChmbOmaQKxWTYGx/nViudnRC8eXlp\n\tE8Ln7uWybMFf8J8IY6+k2vaOVqAa2yID5zfZN5p2jt528QUCc+AaCbEiu0e4YoUKMF0J\n\tTMn5R6I75ot2+MbF8R/5tzV97xUiE1Dpg5ERm0heXLk1qRPUQ6CZC1GPcvmkohvbI8X5\n\trduZKtAAtb6pMIui+FWMJpEJ/4CBTHX8JRDjnnZHP1jMx3BB+3RoIbLr96wlEKN6YsoV\n\toVHA=="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=arc-20160816; \n\th=list-unsubscribe:list-subscribe:list-archive:list-help:list-post\n\t:list-id:mailing-list:precedence:message-id:date:subject:cc:to:from\n\t:arc-authentication-results:arc-message-signature:mime-version\n\t:sender:dkim-signature:arc-authentication-results;\n\tbh=lDbdwI+q46xcmYRM4CzevagSQqhzMKQYXkaOC+9Qfp4=;\n\tb=lbEqw/5AChoMh3M1pt+rwLSgZzWij990GGZ4dB8DV+4XUlt7Tc7b5RdX6tScl6hVQh\n\tGIfbsBEDzR+03eGX1O5r/BpOp6tq1KZ6WGaqzz5LNa1SXEMdNi3eboBPBOnwLuTa0JBY\n\tSE6sSmA70Nh280FvKDDe/vaAQsav/G9uBvWs54WJrJNeN3xY+S1k7WvwTbKNgvr/x4rK\n\tjX2dh1H9xsYQd52VLTyOn/UQpxzLRxpPYw+z73cJH+VRyGRPQJqRx+I8SgtkBhk39AJy\n\trvkiI9vXrX+FhIP2OvCUTsADzuCIm3bQKYZFx6NrcBz8w1ctBsMEDsCW3OmoPlDoYiBE\n\tq/fQ==",
            "i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=arc-20160816; \n\th=message-id:date:subject:cc:to:from:arc-authentication-results;\n\tbh=VvVZHa5nx/q6tWPjbJbWkGf7ZndXXoD/97kKBqM/zEM=;\n\tb=MtDQK6A1Exk00cLmt+SbSnA6NJ6xWJNgEe2ZyYRRp50cYAR3kbwoDHmcY6zLYD66t/\n\tdQejHpAmoDMKjXVhoB4f5/jvOQPocKyH7ENcQ1jIGXnmgpJe714FP7FKrNBDQZnMN2MF\n\tIF+EPrxBhWACDCZiW3fkz9rL9T2dz9wgJNwtsgfSUxugh477aGCcELsrcYsFy6Kthlde\n\tksXgYk4xy5rjV0mPI3DdMXKv43gcsTNkAEEXX/XyGegEVLgEusINyeYl3Ars68jq8F1Q\n\tq9Ley6I5xdZEeRD3wixIqeWA+DudMS/nvAqd7oAet9vky4FYbSjMuBF2bemSqyqM5zyO\n\t3e9A=="
        ],
        "ARC-Authentication-Results": [
            "i=2; gmr-mx.google.com;\n\tspf=neutral (google.com: 192.35.17.14 is neither permitted nor denied\n\tby best guess record for domain of\n\tchristian.storm@siemens.com)\n\tsmtp.mailfrom=christian.storm@siemens.com",
            "i=1; gmr-mx.google.com;\n\tspf=neutral (google.com: 192.35.17.14 is neither permitted nor denied\n\tby best guess record for domain of\n\tchristian.storm@siemens.com)\n\tsmtp.mailfrom=christian.storm@siemens.com"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=googlegroups.com; s=20161025;\n\th=sender:mime-version:from:to:cc:subject:date:message-id\n\t:x-original-sender:x-original-authentication-results:precedence\n\t:mailing-list:list-id:list-post:list-help:list-archive\n\t:list-subscribe:list-unsubscribe;\n\tbh=lDbdwI+q46xcmYRM4CzevagSQqhzMKQYXkaOC+9Qfp4=;\n\tb=WRypK0n8H7rMJPSnvaq/Mf/Vj3Mez5KSBnDlCa5LHDGzuBNDJxO4Q2u7XnmbkS+Z9p\n\t84UD7r14uYn/5CfwZAPj0Hb4JGmi84gO6vEJCEob7B2EoJkYDxvakL3Y/d3S0slTBPN6\n\tA+xDH1OXIQGkZtywQNxNWQhgURuJ0jenGhp8cqXktKrn1aysiCY80XE9IdeQ4otZD9V0\n\txdj7Ga5ecTd1khCNHzQbPXSmiPXiZ7WvIDNjwHl44tw7FCH8XFwzoCYwiqIoNZbV7M7W\n\tlQF21JRSJ38J2T0B2ev9tDQklQrd5yc2vLvs3DOZS/XUNyER25qAPIs2+qcLBifMLIOT\n\tmaTg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=sender:x-gm-message-state:mime-version:from:to:cc:subject:date\n\t:message-id:x-original-sender:x-original-authentication-results\n\t:precedence:mailing-list:list-id:x-spam-checked-in-group:list-post\n\t:list-help:list-archive:list-subscribe:list-unsubscribe;\n\tbh=lDbdwI+q46xcmYRM4CzevagSQqhzMKQYXkaOC+9Qfp4=;\n\tb=XuQKcbgzJd7hc13i7u9MmmCrxemflPcLEn5QUtDrwPRBmhUXLvTHKqYnCs+NO2nmX6\n\tgmeKEmVoQwZO0TN5ImkzdmbZHZ/LzPfYVUGSNKNFW4NfQGFsdEpzUsSXWhlRyhDIWOEH\n\tPEXL+5sZMzQNuCCvKVK1mpVD7IQquf+oyKlcmKZPPKhHVyLViaWovDdEDqo0RBG7Sj6m\n\tODnE9Cd8h36z6gq2vSdUGy9XWuKNyffR+m4b7ug7NbKRtbOuttb6p4wxTNoqjoVVRB3i\n\tQtWbfe9UjcHtzOIid75lcodwu8NTrvd9YRWnQK+JN7bqhRpajDbBXmS6kGi9/XksrJz7\n\tKe3g==",
        "Sender": "swupdate@googlegroups.com",
        "X-Gm-Message-State": "AHPjjUgVVf00n48i6co4U5GsvMVRmThtxhoLH/uh8YWGUDP37Cj3QTjA\n\tjDskfZoa5zLReA==",
        "X-Google-Smtp-Source": "AOwi7QDUwbHReluWb73m09gqPwIvSSuUgN5Hr6GKiVndEoewRvuRXVFFD/4aA+gAiklkMR2WJuW9ng==",
        "X-Received": [
            "by 10.28.87.133 with SMTP id l127mr5568wmb.27.1505475797621;\n\tFri, 15 Sep 2017 04:43:17 -0700 (PDT)",
            "by 10.28.72.135 with SMTP id v129mr301536wma.14.1505475797195;\n\tFri, 15 Sep 2017 04:43:17 -0700 (PDT)"
        ],
        "MIME-Version": "1.0",
        "X-BeenThere": "swupdate@googlegroups.com",
        "Received-SPF": "neutral (google.com: 192.35.17.14 is neither permitted nor\n\tdenied by best guess record for domain of\n\tchristian.storm@siemens.com) client-ip=192.35.17.14; ",
        "From": "Christian Storm <christian.storm@siemens.com>",
        "To": "swupdate@googlegroups.com",
        "Cc": "Christian Storm <christian.storm@siemens.com>",
        "Subject": "[swupdate] [PATCH] core: unlink socket files on normal termination",
        "Date": "Fri, 15 Sep 2017 13:40:30 +0200",
        "Message-Id": "<20170915114030.25138-1-christian.storm@siemens.com>",
        "X-Mailer": "git-send-email 2.14.1",
        "X-Original-Sender": "christian.storm@siemens.com",
        "X-Original-Authentication-Results": "gmr-mx.google.com;       spf=neutral\n\t(google.com: 192.35.17.14 is neither permitted nor denied by best\n\tguess\n\trecord for domain of christian.storm@siemens.com)\n\tsmtp.mailfrom=christian.storm@siemens.com",
        "Content-Type": "text/plain; charset=\"UTF-8\"",
        "Precedence": "list",
        "Mailing-list": "list swupdate@googlegroups.com;\n\tcontact swupdate+owners@googlegroups.com",
        "List-ID": "<swupdate.googlegroups.com>",
        "X-Spam-Checked-In-Group": "swupdate@googlegroups.com",
        "X-Google-Group-Id": "605343134186",
        "List-Post": "<https://groups.google.com/group/swupdate/post>,\n\t<mailto:swupdate@googlegroups.com>",
        "List-Help": "<https://groups.google.com/support/>,\n\t<mailto:swupdate+help@googlegroups.com>",
        "List-Archive": "<https://groups.google.com/group/swupdate",
        "List-Subscribe": "<https://groups.google.com/group/swupdate/subscribe>,\n\t<mailto:swupdate+subscribe@googlegroups.com>",
        "List-Unsubscribe": "<mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>,\n\t<https://groups.google.com/group/swupdate/subscribe>"
    },
    "content": "Currently, the socket files are (re)created on SWUpdate\nstarting but are not unlinked on SWUpdate exiting. Leverage\natexit() and a SIGTERM handler to cleanup socket files on\nnormal program termination.\n\nSigned-off-by: Christian Storm <christian.storm@siemens.com>\n---\n core/swupdate.c           | 14 ++++++++++++++\n corelib/network_thread.c  | 10 ++++++++++\n corelib/progress_thread.c | 10 ++++++++++\n 3 files changed, 34 insertions(+)",
    "diff": "diff --git a/core/swupdate.c b/core/swupdate.c\nindex 3057000..e35289e 100644\n--- a/core/swupdate.c\n+++ b/core/swupdate.c\n@@ -483,6 +483,11 @@ static int read_processes_settings(void *settings, void *data)\n \treturn 0;\n }\n \n+static void sigterm_handler(int __attribute__ ((__unused__)) signum)\n+{\n+\tpthread_cancel(network_daemon);\n+}\n+\n int main(int argc, char **argv)\n {\n \tint c;\n@@ -859,6 +864,15 @@ int main(int argc, char **argv)\n \t\t}\n \t}\n \n+\t/*\n+\t * Install a handler for SIGTERM that cancels\n+\t * the network_daemon thread to allow atexit()\n+\t * registered functions to run.\n+\t */\n+\tmemset(&sa, 0, sizeof(sa));\n+\tsa.sa_handler = sigterm_handler;\n+\tsigaction(SIGTERM, &sa, NULL);\n+\n \t/*\n \t * Go into supervisor loop\n \t */\ndiff --git a/corelib/network_thread.c b/corelib/network_thread.c\nindex 6c34614..5ed516e 100644\n--- a/corelib/network_thread.c\n+++ b/corelib/network_thread.c\n@@ -171,6 +171,11 @@ static void empty_pipe(int fd)\n \t} while (1);\n }\n \n+static void unlink_socket(void)\n+{\n+\tunlink((char*)CONFIG_SOCKET_CTRL_PATH);\n+}\n+\n void *network_thread (void *data)\n {\n \tstruct installer *instp = (struct installer *)data;\n@@ -200,6 +205,11 @@ void *network_thread (void *data)\n \t\texit(2);\n \t}\n \n+\tif (atexit(unlink_socket) != 0) {\n+\t\tTRACE(\"Cannot setup socket cleanup on exit, %s won't be unlinked.\",\n+\t\t\t  (char*)CONFIG_SOCKET_CTRL_PATH);\n+\t}\n+\n \tdo {\n \t\tclilen = sizeof(cliaddr);\n \t\tif ( (ctrlconnfd = accept(ctrllisten, (struct sockaddr *) &cliaddr, &clilen)) < 0) {\ndiff --git a/corelib/progress_thread.c b/corelib/progress_thread.c\nindex 14d4735..e0a11fe 100644\n--- a/corelib/progress_thread.c\n+++ b/corelib/progress_thread.c\n@@ -183,6 +183,11 @@ void swupdate_progress_done(const char *info)\n \tpthread_mutex_unlock(&prbar->lock);\n }\n \n+static void unlink_socket(void)\n+{\n+\tunlink((char*)CONFIG_SOCKET_PROGRESS_PATH);\n+}\n+\n void *progress_bar_thread (void __attribute__ ((__unused__)) *data)\n {\n \tint listen, connfd;\n@@ -201,6 +206,11 @@ void *progress_bar_thread (void __attribute__ ((__unused__)) *data)\n \t\texit(2);\n \t}\n \n+\tif (atexit(unlink_socket) != 0) {\n+\t\tTRACE(\"Cannot setup socket cleanup on exit, %s won't be unlinked.\",\n+\t\t\t  (char*)CONFIG_SOCKET_PROGRESS_PATH);\n+\t}\n+\n \tdo {\n \t\tclilen = sizeof(cliaddr);\n \t\tif ( (connfd = accept(listen, (struct sockaddr *) &cliaddr, &clilen)) < 0) {\n",
    "prefixes": []
}