From patchwork Tue May 16 18:25:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Kuhls X-Patchwork-Id: 91882 Received: from [127.0.0.1] by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1pyzMS-005FOt-1N; Tue, 16 May 2023 18:25:24 +0000 Received: from mailout07.t-online.de ([194.25.134.83]) by www.linuxtv.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pyzMP-005FOW-UE for vdr@linuxtv.org; Tue, 16 May 2023 18:25:22 +0000 Received: from fwd88.dcpf.telekom.de (fwd88.aul.t-online.de [10.223.144.114]) by mailout07.t-online.de (Postfix) with SMTP id EC741487C7 for ; Tue, 16 May 2023 20:25:20 +0200 (CEST) Received: from fli4l.lan.fli4l ([91.58.6.127]) by fwd88.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1pyzMO-129tUg0; Tue, 16 May 2023 20:25:20 +0200 Received: from bruckner.lan.fli4l ([192.168.1.1]:53826) by fli4l.lan.fli4l with esmtp (Exim 4.96) (envelope-from ) id 1pyzMO-0007vP-1l for vdr@linuxtv.org; Tue, 16 May 2023 20:25:20 +0200 From: Bernd Kuhls To: vdr@linuxtv.org Date: Tue, 16 May 2023 20:25:17 +0200 Message-Id: <20230516182517.999918-4-bernd.kuhls@t-online.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230516182517.999918-1-bernd.kuhls@t-online.de> References: <20230516182517.999918-1-bernd.kuhls@t-online.de> MIME-Version: 1.0 X-Spam-Score: -2.5 (--) X-TOI-EXPURGATEID: 150726::1684261520-13FFFE62-AFFDF6C4/0/0 CLEAN NORMAL X-TOI-MSGID: 1de54197-3b1e-418e-9a68-f2a1cb175b3e X-LSpam-Score: -2.6 (--) X-LSpam-Report: No, score=-2.6 required=5.0 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001 autolearn=ham autolearn_force=no Subject: [vdr] [PATCH 4/4] Fix musl build X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: VDR Mailing List Errors-To: vdr-bounces@linuxtv.org Sender: "vdr" malloc_trim is a GNU extension and therefore not present in non-glibc C libraries such as musl. Wrapping this in an ifdef fixes musl builds. Signed-off-by: Bernd Kuhls --- vdr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vdr.c b/vdr.c index 0f426e61..bc4902de 100644 --- a/vdr.c +++ b/vdr.c @@ -1588,12 +1588,14 @@ int main(int argc, char *argv[]) cSchedules::Cleanup(); // Plugins housekeeping: PluginManager.Housekeeping(); +#if defined(__GLIBC__) // Memory cleanup: static time_t LastMemoryCleanup = 0; if ((Now - LastMemoryCleanup) > MEMCLEANUPDELTA) { malloc_trim(0); LastMemoryCleanup = Now; } +#endif } }