qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v3] os-android: Add support to android platf


From: Houcheng Lin
Subject: Re: [Qemu-devel] [RFC PATCH v3] os-android: Add support to android platform
Date: Sat, 3 Oct 2015 12:11:19 +0800

2015-09-28 19:40 GMT+08:00 Paolo Bonzini <address@hidden>:
>
>
> 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

Hi Paolo,
Okay and I will send the patch with these modifications soon. Thanks!

-- 
Best regards,
Houcheng Lin



reply via email to

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