Message ID | 20210810150046.596033-1-sbabic@denx.de |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBJNJZKEAMGQEX3K5OII@googlegroups.com> 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::240; helo=mail-lj1-x240.google.com; envelope-from=swupdate+bncbcxploxj6ikrbjnjzkeamgqex3k5oii@googlegroups.com; receiver=<UNKNOWN>) 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=Kd9y8sRh; dkim-atps=neutral Received: from mail-lj1-x240.google.com (mail-lj1-x240.google.com [IPv6:2a00:1450:4864:20::240]) (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 4Gkbk33CTNz9sRR for <incoming@patchwork.ozlabs.org>; Wed, 11 Aug 2021 01:00:58 +1000 (AEST) Received: by mail-lj1-x240.google.com with SMTP id u3-20020a2e9b030000b02901b787d7d260sf263137lji.3 for <incoming@patchwork.ozlabs.org>; Tue, 10 Aug 2021 08:00:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1628607654; cv=pass; d=google.com; s=arc-20160816; b=ymyYlsLtpxu2hslzlZVklFd8fZzxGx5s/jVpWgLftUPs94Ay5uBPYxKQIB7jObYw5x 7dJaulO9Bc9w23i+veh/Ge02aQQ13m7FwtUEzlPCMwoJAeFL5MBMTlvzdTqYsVoP+5nf YzhCmogCuO5tZ7m3lPIJgrXRAIltd5q0ZqCTW+oKf/1On7b7Sw3B6bJbGCjFiEc0csyP Hh5RedHX3iBmku88uiTxlDH64sKT4rGtLfUEE3mlDTPVX7L5/5RaASwhlPZ3Uq/tGX2+ zZSg9W5zL78m/RPj7FIdjCoJSTRC7aNEfpU2+nQBGtfUk/aJlf4XjCZUwjq9zWMDwnmP rMvA== 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=yItB7ueJ07REN/41bqq8KW3E6kX0QZpoHdyn65Tl12Y=; b=Lkf6P3bc1ouOwIFbgcwZOX8+9t1sFfTT25pW2YnDiQPUJ6+XFuI0c/ZuU6cMjZgjJa UXpwmSz19nBliNP7ZQZ2aZMQSjQXKVLf0pIK/NBd4NhqWB/H3oeXNoqHkPJzs0mTV6tJ 5LED8YANAm/3ybhW8kAanECg/NpXLkYeQFtIstPDbSI+9f6gAZHXNzR2RstH6+GlAM3E F9gUMwoAbS+cqKk1LyLbNKMozunXIwNoRuhX3tdjdHODMdkLE6xwJHuhgvMPIfg+Yc/O h9oH1Df6gngwKzQlp2nays5GUJUg/La2E4/jcV1ZOWow8IKfqqshxAGfo57Ac80rDo01 50yw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de 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=yItB7ueJ07REN/41bqq8KW3E6kX0QZpoHdyn65Tl12Y=; b=Kd9y8sRhXkPbM5nmE4Gj/6LbkLoD1EmqwJTyN8HctlylyUxzzVbdYQ+jeIElAZS12c kUrrOE1jBHDlwztfcDu4xXkxhZpzjZRI6unrWNXxEjMdhHw0d1YvOFYyYF3iF+rj3x8K f5LdkP+8GemOivRB/+bRb/nHDQjBkF/HWKzhytOLWNltobNIQtYNAVlkJsaHMO2lZeR9 agBxaeKnU/4D1YbVNLo9YnzdIXOQkiK0H+8tKW+tHEE2jXHuzbqyw+9yWdU2BJUDKU3z TOe9Koon0I7Z/rkmextAWFkCHFKozgzLs2SdCBfFc4NqU7YfhjQPChM2bUHsnjIO1zCB qRlg== 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=yItB7ueJ07REN/41bqq8KW3E6kX0QZpoHdyn65Tl12Y=; b=ToZKq/3MQG9Sfls6/ImIHxfSRjoaJDKNsBi6JfZ4WaEOUM0ExTqU50S3IRtr+IwVnL 47ekq2LFSMZsxd40Baf5cuGwRPbzFdjrqFVW2QNRhLWlQhGR6irafVgCLdPBH70EeqGr YQF4uNt7LmuUeVOPFH53wW7/Dq1hr6U7gka0G3pPegOOt88oIlDZYGW2f9Ye6CLjLaKE aU9GH480Nj88czvMepmxbO3NmvbBNGIMrLLh0X9m1iAbA2REVsRW9Qcg2gafXz11n0E0 ivs123ny0YR2Uec6HttA2/n/PZyi3dIwVvUHtVMTY8ZjX/boeEmxcHXxMvm9i7FoxIPo Z19w== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM533w56DA3LzCfn4pNacb5sGdISsaT49c8wmHi2SxTgYs2Ab3laC0 Rqbsw0AV3yw0iyCp//dWHN0= X-Google-Smtp-Source: ABdhPJxogx9MDwxaAoNGABGG8SoDaAW001CvX45mQHZksjrgG6asBmCd2TCde+EVBvEUGJiuAY8LQQ== X-Received: by 2002:a2e:2f0f:: with SMTP id v15mr9825541ljv.203.1628607653881; Tue, 10 Aug 2021 08:00:53 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6512:3f02:: with SMTP id y2ls662377lfa.3.gmail; Tue, 10 Aug 2021 08:00:52 -0700 (PDT) X-Received: by 2002:a05:6512:3708:: with SMTP id z8mr21458549lfr.418.1628607652770; Tue, 10 Aug 2021 08:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628607652; cv=none; d=google.com; s=arc-20160816; b=PpyFgPFeNwuUgwh2Dg80cZEhB8PZGvulE1AJg5oUm56r5t4/MUtJByrbpVXJwLqbFV YHe8pG6ifwhvLbaDRKgrSLrBn+VJ2Alz+04aI4juhd97RDzSSecNi6fiwWYOfZT3nZVj OEMzvqx1IOwvxsAy85TfY3HU6HiQqdFcrNcaEdv9tL/afygWj5pDlaEl53dMW0zLCY5V Dxdo7rvVydHmz+iGXHlyS2impu68GDKdJid+3AwVxX5h/YF1kvpwYwwO0IjHO/t+PPDw N+GqtuWmWblddB8Vt1gsUjVSS4SNOgPC73GEe5Ojq8uyWGFF56l/fLrp4FAa5QGF3sRz fLQA== 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=ZKoRnHBgwLL8sVO7hjS4BtoJi0mhuvAhKKmi50HBM8U=; b=Xy3jTc7hiVRyhBFOERS5pw3RnF/0+V0f+nUuqGAxK9WU8a8Cbqo0RVMBckk5Sb4+M2 hxevoFb2+FJsmbkkfN/8gadOuVMphBCIOlvHjh8OeTzaAmWLf7HTHCuSaMuuQ5cbGsaI z/S9hyA9+vCfVEQm0CKHvXL8Aw/Vjy/Nm3FDOAnZre274FyKYWuca+/e60J+4ZyxLgCz Y539r3rmUnJ0LXD4j2FaXaHdl8Jlo5+VD3mCgCmmnPt1Bfh1D2AtksMXSTOAxn2D5Iq/ nOQqgP30a5w63U74Wkjl3jX/zIjBQ5Xo3yUXYJNvtrNRGsyMV9TejyfgVC3S287KAYBd sefg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id q8si151254ljm.2.2021.08.10.08.00.52 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Aug 2021 08:00:52 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Gkbjw1RT2z1qwGj; Tue, 10 Aug 2021 17:00:52 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Gkbjw19mgz1qqyF; Tue, 10 Aug 2021 17:00:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id ZkJLlbFlPz95; Tue, 10 Aug 2021 17:00:51 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Tue, 10 Aug 2021 17:00:51 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 546BC4541460; Tue, 10 Aug 2021 17:00:50 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id ppnZkt0QL43W; Tue, 10 Aug 2021 17:00:47 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id D97E3454086D; Tue, 10 Aug 2021 17:00:47 +0200 (CEST) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH V2 1/3] util: add strtobool() function Date: Tue, 10 Aug 2021 17:00:44 +0200 Message-Id: <20210810150046.596033-1-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de 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 |
[V2,1/3] util: add strtobool() function
|
expand
|
diff --git a/core/util.c b/core/util.c index 8651391..f640c7a 100644 --- a/core/util.c +++ b/core/util.c @@ -715,6 +715,13 @@ unsigned long long ustrtoull(const char *cp, unsigned int base) return result; } +bool strtobool(const char *s) +{ + if (s && (strcmp(s, "true") || strcmp(s, "TRUE"))) + return true; + return false; +} + int swupdate_mount(const char *device, const char *dir, const char *fstype) { #if defined(__linux__) diff --git a/include/util.h b/include/util.h index ad07b18..9f29f5f 100644 --- a/include/util.h +++ b/include/util.h @@ -171,6 +171,7 @@ int IsValidHash(const unsigned char *hash); _a < _b ? _a : _b; }) char *sdup(const char *str); +bool strtobool(const char *s); /* * Function to extract / copy images
Signed-off-by: Stefano Babic <sbabic@denx.de> --- core/util.c | 7 +++++++ include/util.h | 1 + 2 files changed, 8 insertions(+)