qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Houcheng Lin <houcheng@gmail.com>,
	qemu-devel@nongnu.org, famz@redhat.com, alex.bennee@linaro.org,
	linhaocheng@itri.org.tw, peter.maydell@linaro.org,
	kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [RFC PATCH v3] os-android: Add support to android platform
Date: Mon, 28 Sep 2015 13:40:38 +0200	[thread overview]
Message-ID: <56092736.5050908@redhat.com> (raw)
In-Reply-To: <1443100877-8938-1-git-send-email-houcheng@gmail.com>



On 24/09/2015 15:21, Houcheng Lin wrote:
> +if [ "$android" = "yes" ] ; then
> +  LIBS="-lglib-2.0 -lgthread-2.0 -lz -lpixman-1 -lintl -liconv -lc $LIBS"
> +  libs_qga="-lglib-2.0 -lgthread-2.0 -lz -lpixman-1 -lintl -liconv -lc"
> +fi

This change should not be necessary.

> +#define getdtablesize qemu_getdtablesize

Please instead replace all occurrences of getdtablesize with
qemu_getdtablesize.

> 
> +#ifdef CONFIG_ANDROID
> +#include "sysemu/os-android.h"
> +#endif
> +

Please replace this with

#include <libgen.h>

#ifndef IOV_MAX
#define IOV_MAX 1024
#endif

and get rid of os-android.h.

> 
> +#if defined(CONFIG_ANDROID)
> +        char pty_buf[PATH_MAX];
> +        #define ptsname(fd) pty_buf
> +#endif
>          const char *slave;
>          int mfd = -1, sfd = -1;
>  
> @@ -67,17 +72,21 @@ static int openpty(int *amaster, int *aslave, char *name,
>  
>          if (grantpt(mfd) == -1 || unlockpt(mfd) == -1)
>                  goto err;
> -
> +#if defined(CONFIG_ANDROID)
> +        if (ptsname_r(mfd, pty_buf, PATH_MAX) < 0)
> +                goto err;
> +#endif
>          if ((slave = ptsname(mfd)) == NULL)
>                  goto err;
>  


Better:

    #if defined(CONFIG_ANDROID)
        char slave[PATH_MAX];
    #else
        const char *slave;
    #endif

    ...

    #if defined(CONFIG_ANDROID)
        if (ptsname_r(mfd, slave, PATH_MAX) < 0)
            goto err;
    #else
        if ((slave = ptsname(mfd)) == NULL)
            goto err;
    #endif

  reply	other threads:[~2015-09-28 11:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 13:21 [Qemu-devel] [RFC PATCH v3] os-android: Add support to android platform Houcheng Lin
2015-09-28 11:40 ` Paolo Bonzini [this message]
2015-10-03  4:11   ` Houcheng Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56092736.5050908@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=famz@redhat.com \
    --cc=houcheng@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linhaocheng@itri.org.tw \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).