From patchwork Sun Nov 4 20:23:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 197093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C922F2C00F4 for ; Mon, 5 Nov 2012 07:23:50 +1100 (EST) Received: from localhost ([::1]:57704 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TV6jU-0003M6-GW for incoming@patchwork.ozlabs.org; Sun, 04 Nov 2012 15:23:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TV6jM-0003Lr-GC for qemu-devel@nongnu.org; Sun, 04 Nov 2012 15:23:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TV6jL-0004Ez-9K for qemu-devel@nongnu.org; Sun, 04 Nov 2012 15:23:40 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:43357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TV6jL-0004En-3Q; Sun, 04 Nov 2012 15:23:39 -0500 Received: from localhost (v220110690675601.yourvserver.net.local [127.0.0.1]) by v220110690675601.yourvserver.net (Postfix) with ESMTP id 37B7E728002F; Sun, 4 Nov 2012 21:23:37 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at weilnetz.de Received: from v220110690675601.yourvserver.net ([127.0.0.1]) by localhost (v220110690675601.yourvserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IN7VB7cr-NF2; Sun, 4 Nov 2012 21:23:36 +0100 (CET) Received: by v220110690675601.yourvserver.net (Postfix, from userid 1000) id 899A5728003A; Sun, 4 Nov 2012 21:23:36 +0100 (CET) From: Stefan Weil To: qemu-trivial@nongnu.org Date: Sun, 4 Nov 2012 21:23:35 +0100 Message-Id: <1352060615-17419-1-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 78.47.199.172 Cc: Paolo Bonzini , qemu-devel@nongnu.org, Stefan Weil Subject: [Qemu-devel] [PATCH] qemu-timer: Fix compilation for POSIX and non-POSIX hosts X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This compiler error is fixed by including pthread.h: qemu-timer.c: In function ‘init_timer_alarm’: qemu-timer.c:782: error: implicit declaration of function ‘pthread_atfork’ Another compiler warning is caused by the unused local function reinit_timers on non-POSIX hosts. Include that function only for POSIX hosts. Signed-off-by: Stefan Weil --- qemu-timer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qemu-timer.c b/qemu-timer.c index 7b2217a..3bc86cf 100644 --- a/qemu-timer.c +++ b/qemu-timer.c @@ -34,6 +34,9 @@ #ifdef _WIN32 #include #endif +#ifdef CONFIG_POSIX +#include /* pthread_atfork */ +#endif /***********************************************************/ /* timers */ @@ -742,6 +745,7 @@ static void quit_timers(void) t->stop(t); } +#ifdef CONFIG_POSIX static void reinit_timers(void) { struct qemu_alarm_timer *t = alarm_timer; @@ -752,6 +756,7 @@ static void reinit_timers(void) } qemu_rearm_alarm_timer(t); } +#endif /* CONFIG_POSIX */ int init_timer_alarm(void) {