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 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 10 Oct 2010 13:45:16 +0200 Message-Id: <1286711116-431-1-git-send-email-andreas.faerber@web.de> In-Reply-To: <20101009231804.356.1@knochen-vm.localdomain> References: <20101009231804.356.1@knochen-vm.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: andreas.faerber@web.de Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2] trace: Adapt trace file name for Haiku List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: haikuports-devs@ports.haiku-files.org, Blue Swirl , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Ingo Weinhold , Stefan Hajnoczi 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 'unsi= gned 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=C3=A4rber --- 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" =3D "simple"; then fi # Set the appropriate trace file. if test "$trace_backend" =3D "simple"; then - trace_file=3D"\"$trace_file-%u\"" + trace_file=3D"\"$trace_file-%ld\"" fi echo "CONFIG_TRACE_FILE=3D$trace_file" >> $config_host_mak =20 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); =20 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 =3D NULL; return false; } --=20 1.7.3