From patchwork Mon May 17 18:14:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1479784 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=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FkT1h1j6Mz9s1l for ; Tue, 18 May 2021 04:58:48 +1000 (AEST) Received: from localhost ([::1]:38638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liiRx-0007sE-Tc for incoming@patchwork.ozlabs.org; Mon, 17 May 2021 14:58:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lihm2-0006vK-8T for qemu-devel@nongnu.org; Mon, 17 May 2021 14:15:26 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:50405) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lihlZ-0004ZC-CG for qemu-devel@nongnu.org; Mon, 17 May 2021 14:15:25 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MA4ja-1lbWli0kpO-00Bb6h; Mon, 17 May 2021 20:14:52 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 50/59] linux-user: use GDateTime for formatting timestamp for core file Date: Mon, 17 May 2021 20:14:15 +0200 Message-Id: <20210517181424.8093-51-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517181424.8093-1-laurent@vivier.eu> References: <20210517181424.8093-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Zxw0boUnxh5+ng4nNOSdKKbFctpENZNV9N3UauPfRCsGKoySs26 VvBzGDtXfAV91nFP+9YNAm3zxwKizw3B71pJHm2OD8DmMKl0PX+29mgXlPRr130lfK14Age L5XKV+506YHVANR+77DNY2AU/TayO6A1WtKxZ1TlRFLvVvlR5DQs7UxXfS6rW4MovxTGp7D LV7/drUiN/BciZMdnmPIQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:fzCQ9HzHeko=:s8039GZ8/uaXLeM9MgfmO/ qU/H8+eepOTx/CSDSiWZ6XGUrZ2rrbq4Zs2Zrx6kwkt3dE3XukZ82WD8G/QP5KgeqFPDBY5H9 trlCrTdjg1RBkWVpq/8Eh+BiTlbHr0yRPRnKAv8B8s7Xmz0kd/LtdQMgKRVHwJqsfrWQy2tJL LYYLq7E83sJepOrIK54OSuB5uEGp4KmlDHMfO34wsjmhbeznfimIqQJ1XXsICI5OKJKcGWxG9 DMS9N/uqYg1PylPI6DZMjB1QmSGelYgyaPmsDYzK6IwfkqiEKqX4ZIAdpsyG9q5zhRMTb2+sa t7P/8oebhvzhogt+9rH3YBKbbUKlgCz9Vr4QkrTxADK69fnG1V/BjuUk0Grzcoc4+4e3q7LKp 5z5wmMFJPulGQt9myxh+CVU+3W6ySjYG9e+gbD/tUW9rZJ1Iph/FxAyclB6Pdsf6OC4ciFOoj c68Y9YC5T3bbk6ONhv8xqtAPXKYbrLWYzA6bmyyRc+DR7eTRRNz8qCJhxD+0Jzw85ib0FN7TG 3px4JaArO3WsgVjwm0n05Y= Received-SPF: none client-ip=212.227.126.131; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Daniel P. Berrangé The GDateTime APIs provided by GLib avoid portability pitfalls, such as some platforms where 'struct timeval.tv_sec' field is still 'long' instead of 'time_t'. When combined with automatic cleanup, GDateTime often results in simpler code too. Signed-off-by: Daniel P. Berrangé Reviewed-by: Laurent Vivier Message-Id: <20210505103702.521457-7-berrange@redhat.com> Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index ffc03d72f935..015eed1a27b4 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3376,7 +3376,6 @@ static size_t note_size(const struct memelfnote *); static void free_note_info(struct elf_note_info *); static int fill_note_info(struct elf_note_info *, long, const CPUArchState *); static void fill_thread_info(struct elf_note_info *, const CPUArchState *); -static int core_dump_filename(const TaskState *, char *, size_t); static int dump_write(int, const void *, size_t); static int write_note(struct memelfnote *, int); @@ -3675,32 +3674,16 @@ static void fill_auxv_note(struct memelfnote *note, const TaskState *ts) * for the name: * qemu__-