From patchwork Sun Oct 10 11:45:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 67347 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CE1ECB6EDF for ; Sun, 10 Oct 2010 22:47:31 +1100 (EST) Received: from localhost ([127.0.0.1]:56319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4uN7-0005L4-IG for incoming@patchwork.ozlabs.org; Sun, 10 Oct 2010 07:47:21 -0400 Received: from [140.186.70.92] (port=34618 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4uMX-0005Kq-IC for qemu-devel@nongnu.org; Sun, 10 Oct 2010 07:46:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4uMW-0007bb-2J for qemu-devel@nongnu.org; Sun, 10 Oct 2010 07:46:45 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:57729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4uMV-0007bA-Mp for qemu-devel@nongnu.org; Sun, 10 Oct 2010 07:46:44 -0400 Received: from smtp08.web.de ( [172.20.5.216]) by fmmailgate02.web.de (Postfix) with ESMTP id CF49117723B27; Sun, 10 Oct 2010 13:46:41 +0200 (CEST) Received: from [84.148.44.151] (helo=localhost.localdomain) by smtp08.web.de with asmtp (WEB.DE 4.110 #24) id 1P4uMT-0008OM-00; Sun, 10 Oct 2010 13:46:41 +0200 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sun, 10 Oct 2010 13:45:16 +0200 Message-Id: <1286711116-431-1-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.7.3 In-Reply-To: <20101009231804.356.1@knochen-vm.localdomain> References: <20101009231804.356.1@knochen-vm.localdomain> MIME-Version: 1.0 X-Sender: Andreas.Faerber@web.de X-Provags-ID: V01U2FsdGVkX188HxQBLzjioggc/eJB4bX1K+Kck3wslwBKClXM /tOUfYuWJrpeLQNwBDJW8dbPh1lb9KlLnyhJ7uilKo6b4p5Z0r uWZyGvA2F1O2rqE/NBAw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: haikuports-devs@ports.haiku-files.org, Blue Swirl , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Ingo Weinhold , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH v2] trace: Adapt trace file name for Haiku X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Cast the getpid() return value and adapt the format string. Avoids the following warning: CC simpletrace.o /Data/QEMU/qemu/simpletrace.c: In function 'st_set_trace_file': /Data/QEMU/qemu/simpletrace.c:77: warning: format '%u' expects type 'unsigned int', but argument 3 has type 'pid_t' v2: * Don't use %lu for getpid() on Haiku since on x86_64 it returns an int. Always cast to long (largest allowed pid_t type) and use %ld instead. Suggested by Ingo Weinhold. Cc: Stefan Hajnoczi Cc: Blue Swirl Cc: Ingo Weinhold Signed-off-by: Andreas Färber Acked-by: Stefan Hajnoczi --- configure | 2 +- simpletrace.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index d303061..457d98c 100755 --- a/configure +++ b/configure @@ -2609,7 +2609,7 @@ if test "$trace_backend" = "simple"; then fi # Set the appropriate trace file. if test "$trace_backend" = "simple"; then - trace_file="\"$trace_file-%u\"" + trace_file="\"$trace_file-%ld\"" fi echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak diff --git a/simpletrace.c b/simpletrace.c index f849e42..9ee5c3b 100644 --- a/simpletrace.c +++ b/simpletrace.c @@ -74,7 +74,7 @@ bool st_set_trace_file(const char *file) free(trace_file_name); if (!file) { - if (asprintf(&trace_file_name, CONFIG_TRACE_FILE, getpid()) < 0) { + if (asprintf(&trace_file_name, CONFIG_TRACE_FILE, (long)getpid()) < 0) { trace_file_name = NULL; return false; }