Message ID | 20241030101550.21014-5-stefano.babic@swupdate.org |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <swupdate+bncBD2ZDGN6SEKRBXEORC4QMGQE72HGYBI@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=mGjXHvRb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::337; helo=mail-wm1-x337.google.com; envelope-from=swupdate+bncbd2zdgn6sekrbxeorc4qmgqe72hgybi@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-wm1-x337.google.com (mail-wm1-x337.google.com [IPv6:2a00:1450:4864:20::337]) (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 4Xdjh43Mvdz1xy0 for <incoming@patchwork.ozlabs.org>; Wed, 30 Oct 2024 21:16:03 +1100 (AEDT) Received: by mail-wm1-x337.google.com with SMTP id 5b1f17b1804b1-4314a22ed8bsf41409925e9.1 for <incoming@patchwork.ozlabs.org>; Wed, 30 Oct 2024 03:16:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1730283358; cv=pass; d=google.com; s=arc-20240605; b=BKIGJAjrINPvblPjRRuX4XQXNwhsiaImWVMTkLMzSX+UEwh2JwuLoiZGyFMI5n6J6W DNYp1MDZBm0AbysY6bxrBTdi8U1laqXFEdvDRB/P3JSclpl5RiYlUa8ieHSUxO0gIezr 5903S90vnYLkKJOvwTcctS5RRZaN+AL/OXFHwCTogy/KoidXBB3dDNvXilvAKx1o63aJ C5Rzhs+836so/dZ/+bQouYUA4bEQAj0L4iyvBhZSYZQ5qz5X/AVJjLoWRaVdKjj0l7pf rg8yS5CCkDu1bzXmM/jw+tDzfFi4bM9M/XP2fjzb3L78iRbsVMXKeX0OjUWBJMSpRpnk cA/g== 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=02WS0yhVefc5z8R2aVZf4grqgfKtfh44M+B12XgfDto=; fh=HA5J7cRXrCgAVG1VWdv8xNohlckkmfFwGMMIjQfMGnY=; b=ZeBwN2k++hjzI42Y1DWbstbs8uaR4cFsAbHp5ZAHg2cI4gajOKbs3dUEEYbZzCipMd MwvH31DHbaiBpl3f71qaJR+oMuNR8mYJFDhGf6swOByNwLwfNC4TQpfu2Rx1tcyCB29r EF2T2CVh2GgaGyRfXMDFgC2XtxPB4eY2l7mUc3kxHrUrZgDoxgdNTdI5oKrfEMcgV2wF 9ChNpgbuUdxCesgKMiHoe2kGyylNv1jE2woNKXx6HLuSHoBLLN3IcyUwZUR2UYl1BQX4 7lRfrT0yI25XDiVYccHwkHpWYTyzevd+W0coafGX8Cy9eiXROlYZ45hWXXlnjNc054Fl gRzg==; 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=eJFnPmGM; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 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=1730283358; x=1730888158; 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=02WS0yhVefc5z8R2aVZf4grqgfKtfh44M+B12XgfDto=; b=mGjXHvRbvPcnwv1Ihx4cwu66Ep3RcnR8aJwNy5kDVGc9b7L4x9OjtnEGRdm9kk/V4o 8EONoiGVHwKNfJ1VHUBVwEBPUNoKPxrz9BIJwT1c0HLV3bRUD71QzB4klKXl0wbS/vE+ BACko4V2Mb2tIKk/L73D3LIhnXTJ9ma1YWFBoba7tkKoHyyVH0BP246v/BE3s5SITQvp dwNUdEvJvkNhM2jkVHAr7DxdBnckAgMEU/fJDF8suK/zxVOpRS+H5k6hYJZ92pBSROnK HF560dPRpxCppsCeyFqcsA/jPyxHYavCnE6/6JyYQermyYcc/UsiP7DigSO5M5ED2iV0 G7RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730283358; x=1730888158; 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=02WS0yhVefc5z8R2aVZf4grqgfKtfh44M+B12XgfDto=; b=WkxbRcmRgXDPIAri/c7Q02X1Mr2P7fkoNQVSwVr48Ib3gLdBoaKTVuiDQ6ku08zF/o ECqAZD0YpAlRtNKUh4/1cLVkiuVO+aj+oqAcPPR1ib0HZp1YxKI/DEaz3A20U4hFJh/j eOMvgKBs+VaM2TE+LpSZqwjXwlL1iQ+7mr9GX6D3KY35IGw4bjJnG9AiBxvivCpySo14 pzaGpi9KitWzDcuLWqzntmENAHdyablt98hvfb7NINToP/pbqx+FSvwZpqBJBhQoZRpJ oVyAhcF1HsUTtAOkWyQ8lfRTMTNakxDiC0WRp0/7fuY++pMJwsFAUu3Ud8bgqn1lWwpD avuQ== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCXnQ6yRlAle/GYYI6YRJ7gAYOX0Fy6/zsvl4lUCfup6hkW6Jrb8JzHpWtAIvZLbo8pOKgHoF8SZ5g==@patchwork.ozlabs.org X-Gm-Message-State: AOJu0YyNGLJU6ZpdddTnaX7oXerb+Ac/bmsaPssc2axDBb2EHflEvqWb cMvJpK5zx2jujMk3Vmv3v3wOx2TShjMxliQMyZc98QoMHcIQ2VO/ X-Google-Smtp-Source: AGHT+IG5sy4BB6XGAm4peLBK0NFO2Va2za+joRnpEiNFNGgI6kHm7clJku8zkCa+6LXpWTYYwWqP+w== X-Received: by 2002:a05:600c:5647:b0:431:508a:1a7b with SMTP id 5b1f17b1804b1-431bc58eea5mr21802425e9.34.1730283357915; Wed, 30 Oct 2024 03:15:57 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:3b0d:b0:42c:af5b:facf with SMTP id 5b1f17b1804b1-4318a276ddels928015e9.1.-pod-prod-03-eu; Wed, 30 Oct 2024 03:15:54 -0700 (PDT) X-Received: by 2002:a05:600c:1d92:b0:431:40ca:ce5d with SMTP id 5b1f17b1804b1-4319ad0fdc4mr105738495e9.23.1730283354368; Wed, 30 Oct 2024 03:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730283354; cv=none; d=google.com; s=arc-20240605; b=QApLew4oY6aoksBjvXtuWGraKutbsg2R+Gc4Nzg89d7lCFTIdM24kC+HdU4nkTZy5T ar9qaHT80ATATItziLLHd1OoCj5Wmdi4ANZ+Nh0kCdoYA81Qqg2IFBkHk9RDkBT974Bq l3RsaI7gnKOG5rL0YzNM93IzycX2d+HxwMOfrazA+etxVwAEgq3PHy0hoWCtR47g7f/l dirdlLKdFFhOqm5+0kU2WZUdYIsD7wZXx9UqouCrBLgvXFFrFkXq/T7qnvepDJuZmW2n HbR3pdx1jDFYuJWdFZRgHUMqhLFV3pEwe+PtGVrPv9E2PjAoNik1vFNROhFHzxQLkmff 7s6w== 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=CFQjy7kvevSf/n3YqemuyTY7KefCgSZR5v85wIUxu2NfVH5gDyOJoTqZZUgIX5uGQu 9JR1aN+6UQO2l8NpStLTrJ5pA5d3FXUrr2q37LiypvdA+AFEdSn6XxhvUF4kEFqKHgz2 DQ2c1Jwy5J3DGA21SiTDqTEKcomXElyyO8YSN123IjUDBeyHF1hj1EwsMsg/Q6y1C5Gv LmgwtH4Fm2a2YTIS2RjSklPlsONyOqTxUZQFXOpJYdp0CcMaaerNCmOoKmDnhAGhW6ad +rccvPTaYPlFbGtO3aY11Te2LWSPm3ZYtJpm3XmS4B1Dv7pzbAAF2vjcV81MOkfi2iid C3bA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=eJFnPmGM; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [217.72.192.73]) by gmr-mx.google.com with ESMTPS id ffacd0b85a97d-38058ba02ecsi198509f8f.4.2024.10.30.03.15.54 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 03:15:54 -0700 (PDT) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 as permitted sender) client-ip=217.72.192.73; X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue107 [213.165.67.113]) with ESMTPSA (Nemesis) id 1Mofst-1tdYsi2prd-00j4Cu; Wed, 30 Oct 2024 11:15:53 +0100 From: Stefano Babic <stefano.babic@swupdate.org> To: swupdate@googlegroups.com Cc: Stefano Babic <stefano.babic@swupdate.org> Subject: [swupdate] [PATCH 04/10] Cleanup: drop sdup fuction Date: Wed, 30 Oct 2024 11:15:44 +0100 Message-Id: <20241030101550.21014-5-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241030101550.21014-1-stefano.babic@swupdate.org> References: <20241030101550.21014-1-stefano.babic@swupdate.org> MIME-Version: 1.0 X-Provags-ID: V03:K1:xKV0IZOZe9Vyp/vAga+1Z+F39KpbLHNeR5L/ZzGdkugaS44d6j3 CfPyqSAKeidd1bce7W4VZXAanfPEFu7mctgUs+5pvJqjJ5Hk9cIQ7YLsbm9shosJx/+5NsD sg9/ssu2LpRnhL7+IBl474ctPKLmkZfDIt1lpoUA+nKpkd5ebypCRQYgzdxCDpdk/BOKMEt Sm1n+frFNkOJynRIvH9Og== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:eBT1WHt2Cc0=;vTRLn0WHzlEOHvR+I400GmD25lz FmJXtLr1PMUqG4UokI7ZjNoc5gIn+f/fST/VXqhrBEIOl4suXEGY+cpNNySgnXu+Zx2jV0Piq m66UKc2XnhSZQ7fgIemZEp0KqjYop0wqOxT/EF5I0C9d9wVyXrptvNPnJsLnCTn9+bQiAXntd iTOeFE3csAHgzWCgRkC6oqHNsFyhG9InEQ11RVF0i8XRtS9LWtnfakDk4/MUhgo8hqkhrKEXP hPbpMJ+J9PSd6uaD0+0mwCIk1FP8LPwiBXnGGDeeM/IVcyD3vCVyeNkc3n6sX+Yi7hDO4QuD0 G4rDi1pGuLPcNVVIH/xd+LCSJ0otCUQbUDLIIv/l9A4NFAO+RhSDBiMQWGbfdvGwoojC9YoV8 zu1T8PUqCOrc5asJUREM6ugiB3koklPEk9yJhgPwMXle3LUY39fT/IqwkeNp3V8FXXpd11e2L 26W1Y7pijtFJ9mpUD2v30qIHoyZni9PAH5c9m9EncIAbYs2rk3bRXw4ZllswY0QwkWmUV0Qcz YLWBL08yCwqxyBK7e4jQuQRqrOG3KCAgepS+FkncymTakFCx0SwdtCZMPtH2VB3Fe109L/3OJ EA9++HhtZWc4vjSlJufWHIeyFSSSOw4Ux7rkpDdkRGJ0Ivs6tFkLiq1GywMUuY+QGhkbET8Az CH4fbcs4tW/QsWWxTbLf0Ei1R3maNP66BrqLBlW3WF3MtJTvkAmbiXWlT6HRghzkB+JYNWzeA GIzUp0Ph5sq6NQVE9FU+7aqN7p+bNI1WQ== 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=eJFnPmGM; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 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