qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] Darwin: Fix compilation warning regarding th


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v2] Darwin: Fix compilation warning regarding the deprecated daemon() function
Date: Tue, 14 Jun 2011 03:24:24 +0200

Am 13.06.2011 um 22:20 schrieb Blue Swirl:

On Thu, Jun 9, 2011 at 9:47 PM, Andreas Färber <address@hidden> 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 directly.

On OSX >= 10.5, daemon() is deprecated, resulting in the following
warning:
----8<----
qemu-nbd.c: In function ‘main’:
qemu-nbd.c:371: warning: ‘daemon’ is deprecated (declared at
/usr/include/stdlib.h:289)
----8<----

The following trick, used in mDNSResponder, takes care of this warning:

http://www.opensource.apple.com/source/mDNSResponder/mDNSResponder-258.18/mDNSPosix/PosixDaemon.c

On OSX, it temporarily renames the daemon() function before including
stdlib.h
and declares it manually as an extern function. This way, the compiler
does not
see the declaration from stdlib.h and thus does not display the warning.

Signed-off-by: Alexandre Raymond <address@hidden>

Acked-by: Andreas Färber <address@hidden>

Blue, do you want this to go through the cocoa queue (please ack then) or do
you want to apply this directly?

I have a minor style comment, but otherwise this could go via cocoa queue.

I have two further issues on my radar, 1) Alexandre's handleEvent: 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]