Re: [Qemu-devel] [RFC PATCH v4] os-android: Add support to android platform

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

 



On 10/06/2015 03:47 AM, Stefan Hajnoczi wrote:
> On Sat, Oct 03, 2015 at 12:44:14PM +0800, Houcheng Lin wrote:
>> diff --git a/configure b/configure
>> index d7c24cd..cda88c1 100755

>> +++ b/include/qemu/osdep.h
>> @@ -74,6 +74,14 @@ typedef unsigned int            uint_fast16_t;
>>  typedef signed int              int_fast16_t;
>>  #endif
>>  
>> +#ifdef CONFIG_ANDROID
>> +/*
>> + * For include the basename prototyping in android.
>> + */
>> +#include <libgen.h>
> 
> Files that use basename(3) should include libgen.h.  Why include it
> here?

What is using basename(3)? POSIX gives basename(3) a worthless contract
- it is free to return non-thread-safe storage.  Also, it is not
portable to Windows-style drive-letters, so I consider any code using
<libgen.h> to already be suspect.

If you are already writing code to be ported to both Unixy and windows
systems, you are better off rolling your own alternative to basename (or
better, using something else that has already rolled a portable version
for you - while I know gnulib does that, we aren't using gnulib; but I
assume glib has something along those lines even though I haven't looked
for it).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux