Received: from eggs.gnu.org ([140.186.70.92]:43650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWIMn-0000FV-Fb for qemu-devel@nongnu.org; Mon, 13 Jun 2011 21:24:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWIMl-0004Ak-UI for qemu-devel@nongnu.org; Mon, 13 Jun 2011 21:24:29 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:45267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWIMl-0004Aa-6X for qemu-devel@nongnu.org; Mon, 13 Jun 2011 21:24:27 -0400 Message-Id: From: =?ISO-8859-1?Q?Andreas_F=E4rber?= In-Reply-To: Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v936) Date: Tue, 14 Jun 2011 03:24:24 +0200 References: <1307417650-12955-1-git-send-email-cerbere@gmail.com> <3F92F108-6AEF-4041-AA1C-895EA552D012@web.de> Sender: andreas.faerber@web.de Subject: Re: [Qemu-devel] [PATCH v2] Darwin: Fix compilation warning regarding the deprecated daemon() function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Alexandre Raymond , Peter Maydell , qemu-devel Developers , Alexander Graf Am 13.06.2011 um 22:20 schrieb Blue Swirl: > On Thu, Jun 9, 2011 at 9:47 PM, Andreas F=E4rber =20 > wrote: >> Am 07.06.2011 um 05:34 schrieb Alexandre Raymond: >> >>> Changes since v1: create a wrapper function named qemu_daemon() in >>> oslib-posix.c >>> instead of putting the OS specific workaround in qemu-nbd.c =20 >>> directly. >>> >>> On OSX >=3D 10.5, daemon() is deprecated, resulting in the following >>> warning: >>> ----8<---- >>> qemu-nbd.c: In function =91main=92: >>> qemu-nbd.c:371: warning: =91daemon=92 is deprecated (declared at >>> /usr/include/stdlib.h:289) >>> ----8<---- >>> >>> The following trick, used in mDNSResponder, takes care of this =20 >>> warning: >>> >>> = http://www.opensource.apple.com/source/mDNSResponder/mDNSResponder-258.18/= mDNSPosix/PosixDaemon.c >>> >>> On OSX, it temporarily renames the daemon() function before =20 >>> including >>> stdlib.h >>> and declares it manually as an extern function. This way, the =20 >>> compiler >>> does not >>> see the declaration from stdlib.h and thus does not display the =20 >>> warning. >>> >>> Signed-off-by: Alexandre Raymond >> >> Acked-by: Andreas F=E4rber >> >> Blue, do you want this to go through the cocoa queue (please ack =20 >> then) or do >> you want to apply this directly? > > I have a minor style comment, but otherwise this could go via cocoa =20= > queue. > >> I have two further issues on my radar, 1) Alexandre's handleEvent: =20= >> warning >> and 2) the big sigfd issue, and would then send a pull request. >> >> Andreas >> >>> diff --git a/oslib-posix.c b/oslib-posix.c >>> index 7bc5f7c..5392e25 100644 >>> +int qemu_daemon(int nochdir, int noclose) { > > Here the brace should be on a new line. Fixed. Andreas=