Message ID | 20241030163957.2822282-5-stefano.babic@swupdate.org |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBD2ZDGN6SEKRBYWCRG4QMGQEPF2WGAI@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=G+H3HoPV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::33b; helo=mail-wm1-x33b.google.com; envelope-from=swupdate+bncbd2zdgn6sekrbywcrg4qmgqepf2wgai@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-wm1-x33b.google.com (mail-wm1-x33b.google.com [IPv6:2a00:1450:4864:20::33b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XdtCF3cPZz1xy1 for <incoming@patchwork.ozlabs.org>; Thu, 31 Oct 2024 03:40:08 +1100 (AEDT) Received: by mail-wm1-x33b.google.com with SMTP id 5b1f17b1804b1-4314f023f55sf113615e9.2 for <incoming@patchwork.ozlabs.org>; Wed, 30 Oct 2024 09:40:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1730306404; cv=pass; d=google.com; s=arc-20240605; b=LRHcoBg/eJM2Ivh7pXLffaBTwg4X2vUGCt4pC323GqnD9nnQi//zrPI9EaoRlFUQXn YGgzZJThNK37ovoBIPVeup4FLGY1Zhed/5Dg3XjWJucmPvkbXKAZnkl2+AVzK6Y9c6Lz zuk/0hYxhYn+hZBxJC138Zsbe23zphw0NNp8S97y76+0tccxo/fQrLuByiAS8jccO/Nr T0lmi6M6kMHdi/sECIv/kz5trf62kIlNiDEqxIFm5CGQCTdCv8dPTjIZKuP7Z3QqUYaw 2eAw4Pl9E67Rqu3pUuTlUdYkyLhc7py4wCPqYU6GnL2/2uyFGNqRMylDoMMHaJ1oR/Fy FCzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:ui-outboundreport:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=/0SEk4OY2jLcjkp7lYwKZt8m9h93ito7n5/e1mReQKw=; fh=D3uJGRZ0V6pTTCz1W0HtPAhgNIfUm/RZus6zvelanYI=; b=A5bsXXOOUTEAnLvgHYZvHIGchCDIW7nOxy4ut+M1tevY5wgs45UKYKmNltQhlsvkdz PkkEtn5hfFD3ZlFxZexTYyoI8Nvlkhsq7f/DyJvyYnEbeDftktoW3h3doBOlJhvAqCq7 ATuUnBwrojgZ3eiVLXrUSJ8BzqU2sIpQuA0WzxTh6GMN6HINq7Jr45xNVn/SmAsJvxtU t4hKp+DzxUhwlRh5KdNqdTyIAyeh88vbt/pXVBNkia9NFT+wbKxS3TrT9I/KxWqZPaLy BUmCUgSHk/ACgULR6Rx5CayVa6yyxZqQKdfgLA0/ckjt9hnk8kT4LM/5iNoBeKluCLYU V8YQ==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=11C4DaYr; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.126.131 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1730306404; x=1730911204; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:ui-outboundreport:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=/0SEk4OY2jLcjkp7lYwKZt8m9h93ito7n5/e1mReQKw=; b=G+H3HoPVXyG9iwtgyvcBVBYldUcp4I7kxD3MHj+s4UNpOKE88iw8l29VmJXfLfunS5 wbaNv3lJ4z9njt/pc22CYnJLwo0pZsoOm8ET2RPSq55BpuRxOg5WeyPAEJ7J2IzocDVC +MaOnYqtBYUjse1aspLES5IwIHFW8oSAjIobRmxDSkvq/J0qUhbKZIsQhEgye4aexg+n FpoFLEqGplOTRtfMyl8HQRTXNrsiUuH1P64FWpqRhuLs6gztXiXAJeVm+dsdFIY9RRrB Zyp4YppuuE1OTdv8Qp95h9qweBTH1//O039C1TuU0Gnt/ilGg+0S2IVrUkzW9ELpEg2p QXVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730306404; x=1730911204; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :ui-outboundreport:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=/0SEk4OY2jLcjkp7lYwKZt8m9h93ito7n5/e1mReQKw=; b=SJkk/dHtVHemGt8A2/ZjrSr1aRrvCimZP1NCj3EK3kTyV7gbwS+C+79AoLCJVoNPOE YNYnD1DrcUafeDQALTS/I96+9H9UdiyZUEtN/MZe+y8YnyR8IrXQOdxgXVNryC4RCXks Xps52QcwQBP0B5huK7WU1OIfzRVjDYHcuyvF2KeT8xBcPt6TD/SezS/LXvBrvr1BC8BM Yh3/yDPUBonh8iwr9NMeHZDMPAK1cn6ECvAjohONQhXSVJ8qVPgFXFh9zkMKlw60ozyM TcBEuSEDRKNI3CYiEOElL+XtoIZ99n7bO2lENABpdKNZfauTE0KIrHSrO6JRV2ur6g4Z L/0g== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCWR63RNzlXRoIRqB14KQZ3u3zmrtk6t3IXRCsRZjsTi9f1O9UneG0oQOMHRwTeWMN0nVmvXhBElmQ==@patchwork.ozlabs.org X-Gm-Message-State: AOJu0YyW/lvD/aym7pgH8whE9Xnkf0z0vOckuPE3+6n1vU3rJhxLevj4 SrlnrYXP6XljPwIDsGLUZgz3fuHzd4PGRhPGBstHwWAABLS2tix6 X-Google-Smtp-Source: AGHT+IH7jc5ZxGyHuA2HeFZE4qPBAMUDBB8LC0ugOrQChXeBKPbD+tMX9M8vl2EgN2oCenn/0Jrw0w== X-Received: by 2002:a05:600c:4510:b0:431:3927:d1bc with SMTP id 5b1f17b1804b1-4319ac70767mr147811935e9.2.1730306403719; Wed, 30 Oct 2024 09:40:03 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:1386:b0:42c:af5b:facc with SMTP id 5b1f17b1804b1-4327b8020ffls323815e9.1.-pod-prod-07-eu; Wed, 30 Oct 2024 09:40:00 -0700 (PDT) X-Received: by 2002:a05:600c:138d:b0:431:5f1c:8362 with SMTP id 5b1f17b1804b1-4319ad4176cmr120387175e9.35.1730306400019; Wed, 30 Oct 2024 09:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730306400; cv=none; d=google.com; s=arc-20240605; b=DwONJfHiQWdnWvVjyenWDDK+H1ZZFMrZbwBHml6oZV4/rd5pCuJEOOI+dOvk9tOuUr OAe+27pdMWn6Vh5QJCwlWln+9Y4Zry/fOWO/Lyglf5IVGkdCmJ0NCyrjQEQ3xv8cPl9v GeWrUg8nEgKPI3TToVz4yt0lwUNuVoELp5rK8E63CdsCtDXEu5GOEL3EALLfy9XjmzXa N5PFlxXcrTJD1vsTbjNJ10xLFCAInwLJw1+EKfiVzn/9hsWXFd2Qi0jzLMzczinDO8SK X9qhmG5ZQvMjNWoG3PJvAtKBnt8koFUJ6kkMpF3TN8fHky+CIzJD21R/vhlR0Z3u6aqW hSlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=ui-outboundreport:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=W8L2ey60UhLom/iOgGO15cDG+YuulJxz9llMAL6VFR8=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=R1uwvCoR8z5ufKnvzlmDoD+JKM9Lp6iCh9W0Jw9qq04fMYMXo32rhjmzUMWwrRsxux GvXSfRZ6jzcl4VevcH42BC7UJn+SLyHjX0WBsT3Cmd+X2wkN3MBeV1VICV9JCk9WDtTE kqunGgYA3sI14rK0W8/Q4DS3Qg4Cb6Rp7r2R8GZfgAdM1igw65pjqhq67gy/twgT1MVV fjmMtpkMXbyNYM4nppquVD0x3HVeo36dHhbmZsPcRzpBB3U0ViSMk5mWMdQs03mpl6SP /Yn1QEskhzzeipMl3z5p0oESKsES1gVcC3lCaHSKmhiM+bUcHtWndvqx+RT/rtVLNTAv jbeA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=11C4DaYr; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.126.131 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.126.131]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-431b43a99dbsi3056365e9.0.2024.10.30.09.39.59 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 09:40:00 -0700 (PDT) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.126.131 as permitted sender) client-ip=212.227.126.131; X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue010 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MhDIw-1tjOQv2SsU-00olNC; Wed, 30 Oct 2024 17:39:59 +0100 From: Stefano Babic <stefano.babic@swupdate.org> To: swupdate@googlegroups.com Cc: Stefano Babic <stefano.babic@swupdate.org> Subject: [swupdate] [PATCH V2 04/10] Cleanup: drop sdup fuction Date: Wed, 30 Oct 2024 17:39:51 +0100 Message-Id: <20241030163957.2822282-5-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241030163957.2822282-1-stefano.babic@swupdate.org> References: <20241030163957.2822282-1-stefano.babic@swupdate.org> MIME-Version: 1.0 X-Provags-ID: V03:K1:hlNWf5bLtFO4N4bLgeZycDcNREE02fOSSZ/40Cdwk0YMcJkIhF5 onG+eGEefPe/gULcKMUYZTFhHZncXcpI6Ey6LKQ8SH9EuB1CQkHuzI7A/GTO23dHdx4Jx+W LKZYY1q42iPKGrurhg2PQutnYMj3FMsT1ZhxRz/LPg1hnrLMgIP8r5LFTCymQIVoH98xX3u rAj4J9JqgJ5x8DJaHz9uA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:+b16DR2+juk=;u1VA+B2y0n9LHc8LtO31BBFk2sS NbcXrQjoXXfavx1IRMADkAAqVjPTRp2nX/wcdkyuALW1NFj7/NkEeQfIIt4aZ5E0e+SQVvFb5 i9ikjh44FRdP080+tvYyrS1wWAhEBB0uNKniuNKUeanpBPX8HmJLcdgMS8GidmYyyGodOoe7Z sfj0R3SixRB+XmtUUNuqwBlpSZJmXXuU2+MyDxdYzbMwlk4FukVzhHLHTnHPut+WyxcorzC61 cxfSqW90Uwudc4E8vksMib/KTa7JepM7zjmuuUuqZ9bliZOQCrQi9wAxDuYOk0sM+MFgJbuYW Y/aEon6XnJq+zJMNr+PxgOVegJog9BaBjLvvd4y3HNe6EJ2RoNqa0wK8n5V4j/TeSDqExMZxy IRoTmrVGM/kTSU+dkqUSugvA9fz4zcMjGkdxrKsNmfplAWMY291Jvki6wpRdidQ1UW1w+clS3 kAJGq+7EjGSLZuaFhmGNfv09ZCS/cPBwOd99Cqoli0uAc98eAnaBoSM3QdIRLUAkz6GxFFmwN 6gxFH1JJ9uSKVvl10WeNn8/YMR+jdYTpgoHnhh291RiYFhQpjnS9J+PEb24spAPqVLTs0rhqy anoRx4RqjMIf0byOMJQiMjeZ518ov1Ue1EDgANrGtJQlHWPw2q4rJwNN06+7f6ZrVxdTpG1Fu FjAg6eSpBQiK+o2ha21j54xF15x9gXCbabkmk6GYOt4P623e0zY54UU+5L2YXPhhUOGqD4l+Z yCOnfs2kwghbr4nOXLk4+1KJUQbP2QGxA== X-Original-Sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=11C4DaYr; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.126.131 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact 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>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
Introduce BTRFS Snapshot Handler
|
expand
|
diff --git a/core/swupdate.c b/core/swupdate.c index 4b98add9..d59df204 100644 --- a/core/swupdate.c +++ b/core/swupdate.c @@ -530,7 +530,7 @@ int main(int argc, char **argv) char *root; int bootdev; case 'f': - cfgfname = sdup(optarg); + cfgfname = strdup(optarg); break; case 'g': root = get_root_device(); @@ -570,7 +570,7 @@ int main(int argc, char **argv) if (cfgfname == NULL) { struct stat stbuf; if (stat(CONFIG_DEFAULT_CONFIG_FILE, &stbuf) == 0) { - cfgfname = sdup(CONFIG_DEFAULT_CONFIG_FILE); + cfgfname = strdup(CONFIG_DEFAULT_CONFIG_FILE); } } diff --git a/core/util.c b/core/util.c index 1e50d948..d50176fc 100644 --- a/core/util.c +++ b/core/util.c @@ -59,14 +59,6 @@ static struct decryption_key *aes_key = NULL; static char *fwenv_config = NULL; -char *sdup(const char *str) { - char *p; - if ((p = (char *) malloc(strlen(str) + 1)) != NULL) { - strcpy(p, str); - } - return p; -} - static char* TMPDIR = NULL; static char* TMPDIRSCRIPT = NULL; diff --git a/include/util.h b/include/util.h index 1ac108be..dcfbd4f0 100644 --- a/include/util.h +++ b/include/util.h @@ -211,7 +211,6 @@ bool is_hex_str(const char *ascii); #define max_t(type,x,y) \ ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; }) -char *sdup(const char *str); bool strtobool(const char *s); /*
This has the same implementation of strdup(), and it makes no sense to have it. Drop it and switch back to strdup. Signed-off-by: Stefano Babic <stefano.babic@swupdate.org> --- core/swupdate.c | 4 ++-- core/util.c | 8 -------- include/util.h | 1 - 3 files changed, 2 insertions(+), 11 deletions(-) -- 2.34.1