From patchwork Fri Apr 24 14:49:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Storm, Christian" X-Patchwork-Id: 1276425 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::43f; helo=mail-wr1-x43f.google.com; envelope-from=swupdate+bncbdd6bwv65qpbbixyrp2qkgqevf4tm4y@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=siemens.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=D5LQlcdH; dkim-atps=neutral Received: from mail-wr1-x43f.google.com (mail-wr1-x43f.google.com [IPv6:2a00:1450:4864:20::43f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 497xqX6dmwz9sSW for ; Sat, 25 Apr 2020 00:48:07 +1000 (AEST) Received: by mail-wr1-x43f.google.com with SMTP id g7sf4862116wrw.18 for ; Fri, 24 Apr 2020 07:48:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1587739683; cv=pass; d=google.com; s=arc-20160816; b=vsyHaTQq0kFPCfq2UYL+V3pp6zwybcPjBihMk3gbjw9ts5EG5R+k5fQXfCIDvtIewI QD/6aAm6ZX74rCaub2TiFSln4TZEMeKQqSxUiDhv3YDHj8ycx87mLHNlH5gvx6odiEWR G6I2lc1jkSzfsu7qQXl2o2dM7hK/Ps/Q1YfnBRT8bmjjmxsfm/Rla96spImR+Ahw6BJa TUzot0fGz0AKvFmKRqZowjQPVBaLTFHGpEyethwx2k0Kbv73EZZHk9NOdZVOOfSH2hUY /3apyllSi8b45KW5C4q774vLzYY+jKwVeePGCw/O/QSmK3aaz5CLjFpYlhph8/mV9SXC qPig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=scOjjHjNazObw/vT/SnbQh1YMBo95dirRfihgYzBsAM=; b=WLGl32EzN9u/Uqt3WASl4T7IGKGnoB5u/Ei8AWEHGtI81aNx28wu1xkZMErxzPSsCZ yjPXyCgxRiHq6kK0AMiZv90YPXbp6LWURRiC5FdoSnxpitbh8mTBpCvG4BcnjDIZd/1N jnpZCmtiniFVa9tgPWOiDmsoMMuwgk/xrUbglkc3Nl7640X73Jv3iouZtq3fDmF6vihY aXauVslT2O6VH5rrICTcsMg5TJ5bmxsS6AiC3DWdb09odukX8wSdYdKEVlzS8/C87y4X QltZV4o5DXJCmjArosZtoMVwKTfvq2uWhdWYit1FTyMenxM5c7C1sjrZ/JUlYAz1KG4s KVnA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=christian.storm@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=scOjjHjNazObw/vT/SnbQh1YMBo95dirRfihgYzBsAM=; b=D5LQlcdH7jZYgRd7JT90z2It1PPhbpEVbhI11mWEPc2jfVclURv9fwArz4pHKsPzVI 1CSilrrDyMBpSbr1pDu68Sg6cnR2I3xcHisHzL7mlBB2gnzX4tyN2llbZrp+LDKqfXwI zS8FpDjtxDLfto0vsKAIEpUVM2QmNtD1FW5Ueztlo8bG2A4uaPiAwcnplu4UEfqJy581 M1lJoyzHICk5HRiJEe9BuFopgE4nt1kTr0njivMcz6Jg4Cj7ZHwLkSmwjXGPiEUc1Jxj 2FTXQEGNSLPJFMh1Fvi2DhdHEZIHfB0sCgIav6+tnnRwukhEn00ofYQgELzsA3rzWhTB zXPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=scOjjHjNazObw/vT/SnbQh1YMBo95dirRfihgYzBsAM=; b=RlyZ6uSBmX0+z57DHmNxK2uLDQDgT3a91L4kit2dCfqnXAfFLSrth1saoVCmaGucXL mcA45RTOKdIDQOpoiFfp2ba3e6wvz/PoSmwPhurz/BQdXXiL30sqG4Nw9ViJBy/Cfyog kfSKBSwHMsNWj4AAun4xwqlv/9kakUpUdZS9EeeK+0jdb0lH9P6feVz7UkXZP24aJpWq Ian5nOLhTUR375yoyr+5arjnJwllUxDFRjRlMBTrCkkce6GvdikiEfkdLYgfWe6QtZ1V FmVg+Ei2zixCCapO8XpBUypcSkq9mtAyk/I2/4eEa713684km6bOfxZLNu+3FbXazCTj +SGQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: AGi0PuYM++yL8s7X5GOxDILuLawew3XInN+SBVkBtJ3FbuJjWwZTvsrh pLSvvNnhRV3LPamChyHoYy0= X-Google-Smtp-Source: APiQypLzg3dN8f8iAqvi1/e4LN/1lGsOZq4EwTpoc1UF3sZoN4ZOABH/fyPfJnVdx4LN9ldDqH5y0Q== X-Received: by 2002:a7b:c147:: with SMTP id z7mr11231036wmi.52.1587739682986; Fri, 24 Apr 2020 07:48:02 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:adf:f6c4:: with SMTP id y4ls9642696wrp.2.gmail; Fri, 24 Apr 2020 07:48:02 -0700 (PDT) X-Received: by 2002:a5d:68ca:: with SMTP id p10mr11626739wrw.154.1587739682374; Fri, 24 Apr 2020 07:48:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587739682; cv=none; d=google.com; s=arc-20160816; b=cJkYQP9bhlWk3cx0sMF5rzm9hbKIy5HYAbwJhW6bQeQwCgFkMdU/CVoJGlh13RrbWh +9MicT1XO8E+9fD62a8A0OyMAVMNIRVWJWTmUeqTUcOCDyKeKuwHAxGlCwjMtuirGJJe 2zpEvlXNJFjofb4yhk/Yeehntoqmz/6qZV/w5LZXsSamZ6ZynyTElar83WP/4acPU5lN aIarhN+E0vyGjSSP6ruK3JPgGdzpmq/+X19zLzbEDoBptdIAgZLAGblMz3pMK0yPNSFh fLD7PLIZDhjRSI612Ya6J6yuiIH5sRRfegUjeqCX2TK6iWUCyQWNK0SK7XRets9QIZGn oTYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=BTLxOBhz288hPTJoYeSwAdJODtnip/5rbUB5w4gM3w4=; b=yfyKsgCUueHbV549qwxgnoxlElqaH3/vPBMUnlZCDbokIK46KNB36n64DfzWwlfltF fssaDuLcxBq9e9xo/3D3YFDcpMTaSM96+6g8TJWzmhAgMaTBYaDQt7u0i/89tOhRlloo O0kzTLHjB+EDyaKfv4HeU8cXDTXcRP84MWLLwPgRExMRQEhMToIR7pAraa1Uwlkb1jHg 4i3RIONBh1hXtx/QJSWGhe6hyCg5evX81+KZGDo/bUA1B+ODGK845hFzB1cOASnSdT6z DgOwkLWa2y5W8+Cs0bPmVIlFsWL5Bez9v9cwfnzFakCfzHRdf7cyUfeXDF3n8sOHnaLV InHA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=christian.storm@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id m4si403908wrn.5.2020.04.24.07.48.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Apr 2020 07:48:02 -0700 (PDT) Received-SPF: pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id 03OEm2jb029724 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 24 Apr 2020 16:48:02 +0200 Received: from MD1ZFJVC.ad001.siemens.net ([167.87.0.148]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id 03OEm1o9000643; Fri, 24 Apr 2020 16:48:01 +0200 From: Christian Storm To: swupdate@googlegroups.com Cc: Christian Storm Subject: [swupdate] [PATCH] Consolidate variable naming for the dry run option Date: Fri, 24 Apr 2020 16:49:30 +0200 Message-Id: <20200424144930.30928-1-christian.storm@siemens.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Original-Sender: christian.storm@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=christian.storm@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , There are different spellings for the dry run option, consolidate them to dry_run. Signed-off-by: Christian Storm --- core/network_thread.c | 2 +- core/stream_interface.c | 2 +- corelib/channel_curl.c | 2 +- include/network_ipc.h | 4 ++-- ipc/network_ipc-if.c | 4 ++-- ipc/network_ipc.c | 4 ++-- tools/swupdate-client.c | 8 ++++---- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/network_thread.c b/core/network_thread.c index 0fd6227..41f17e5 100644 --- a/core/network_thread.c +++ b/core/network_thread.c @@ -350,7 +350,7 @@ void *network_thread (void *data) instp->len = min(msg.data.instmsg.len, sizeof(instp->info)); /* - * Communicate if a dryrun is asked and set it + * Communicate if a dry run is asked and set it */ if (msg.type == REQ_INSTALL_DRYRUN) instp->dry_run = 1; diff --git a/core/stream_interface.c b/core/stream_interface.c index bf502e5..e0d6fa4 100644 --- a/core/stream_interface.c +++ b/core/stream_interface.c @@ -501,7 +501,7 @@ void *network_initializer(void *data) notify(START, RECOVERY_NO_ERROR, INFOLEVEL, "Software Update started !"); /* - * Check if the dryrun flag is overwrittn + * Check if the dry run flag is overwritten */ if (inst.dry_run) software->globals.dry_run = 1; diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c index 128f2ec..5acae2c 100644 --- a/corelib/channel_curl.c +++ b/corelib/channel_curl.c @@ -898,7 +898,7 @@ channel_op_res_t channel_get_file(channel_t *this, void *data) file_handle = ipc_inst_start_ext(channel_data->source, channel_data->info == NULL ? 0 : strlen(channel_data->info), channel_data->info, - false /*no dryrun */); + false /*no dry run */); if (file_handle > 0) break; sleep(1); diff --git a/include/network_ipc.h b/include/network_ipc.h index 9cc40f8..520ae09 100644 --- a/include/network_ipc.h +++ b/include/network_ipc.h @@ -78,7 +78,7 @@ typedef struct { char *get_ctrl_socket(void); int ipc_inst_start(void); -int ipc_inst_start_ext(sourcetype source, size_t len, const char *info, bool dryrun); +int ipc_inst_start_ext(sourcetype source, size_t len, const char *info, bool dry_run); int ipc_send_data(int connfd, char *buf, int size); void ipc_end(int connfd); int ipc_get_status(ipc_message *msg); @@ -92,7 +92,7 @@ typedef int (*terminated)(RECOVERY_STATUS status); int ipc_wait_for_complete(getstatus callback); int swupdate_image_write(char *buf, int size); int swupdate_async_start(writedata wr_func, getstatus status_func, - terminated end_func, bool dryrun); + terminated end_func, bool dry_run); #ifdef __cplusplus } // extern "C" diff --git a/ipc/network_ipc-if.c b/ipc/network_ipc-if.c index 1f6a4d7..06cf74c 100644 --- a/ipc/network_ipc-if.c +++ b/ipc/network_ipc-if.c @@ -108,7 +108,7 @@ static pthread_t start_ipc_thread(void *(* start_routine) (void *), void *arg) * Only one running request is accepted */ int swupdate_async_start(writedata wr_func, getstatus status_func, - terminated end_func, bool dryrun) + terminated end_func, bool dry_run) { struct async_lib *rq; int connfd; @@ -122,7 +122,7 @@ int swupdate_async_start(writedata wr_func, getstatus status_func, rq->get = status_func; rq->end = end_func; - connfd = ipc_inst_start_ext(SOURCE_UNKNOWN, 0, NULL, dryrun); + connfd = ipc_inst_start_ext(SOURCE_UNKNOWN, 0, NULL, dry_run); if (connfd < 0) return connfd; diff --git a/ipc/network_ipc.c b/ipc/network_ipc.c index 96215e9..9b5d811 100644 --- a/ipc/network_ipc.c +++ b/ipc/network_ipc.c @@ -175,7 +175,7 @@ int ipc_get_status_timeout(ipc_message *msg, unsigned int timeout_ms) return ret; } -int ipc_inst_start_ext(sourcetype source, size_t len, const char *buf, bool dryrun) +int ipc_inst_start_ext(sourcetype source, size_t len, const char *buf, bool dry_run) { int connfd; ipc_message msg; @@ -191,7 +191,7 @@ int ipc_inst_start_ext(sourcetype source, size_t len, const char *buf, bool dryr * Command is request to install */ msg.magic = IPC_MAGIC; - msg.type = (!dryrun) ? REQ_INSTALL : REQ_INSTALL_DRYRUN; + msg.type = (!dry_run) ? REQ_INSTALL : REQ_INSTALL_DRYRUN; /* * Pass data from interface originating diff --git a/tools/swupdate-client.c b/tools/swupdate-client.c index d73d2bb..32928f5 100644 --- a/tools/swupdate-client.c +++ b/tools/swupdate-client.c @@ -39,7 +39,7 @@ static void usage(void) { fprintf(stdout, " Available OPTIONS\n" " -h : print help and exit\n" - " -d : ask the server to only perform a dryrun\n" + " -d : ask the server to only perform a dry run\n" " -q : go quite, resets verbosity\n" " -v : go verbose, essentially print upgrade status messages from server\n" " -p : ask the server to run post-update commands if upgrade succeeds\n" @@ -49,7 +49,7 @@ static void usage(void) { char buf[256]; int fd = STDIN_FILENO; int verbose = 1; -bool dryrun = false; +bool dry_run = false; bool run_postupdate = false; int end_status = EXIT_SUCCESS; @@ -130,7 +130,7 @@ static int send_file(const char* filename) { end_status = EXIT_SUCCESS; rc = swupdate_async_start(readimage, printstatus, - end, dryrun); + end, dry_run); /* return if we've hit an error scenario */ if (rc < 0) { @@ -165,7 +165,7 @@ int main(int argc, char *argv[]) { while ((c = getopt(argc, argv, "dhqvp")) != EOF) { switch (c) { case 'd': - dryrun = true; + dry_run = true; break; case 'h': usage();