[libvirt] [PATCH 3/3] cleanup: Kill usage of access(PATH, F_OK) in favor of virFileExists()
Peter Krempa
pkrempa at redhat.com
Mon Sep 16 09:32:11 UTC 2013
On 09/13/13 17:31, Martin Kletzander wrote:
> On 09/13/2013 04:19 PM, Peter Krempa wrote:
>> Semantics of the libvirt helper are more clear. This change also allows
>> to clean up some pieces of code.
>> ---
[...]
>> diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
>> index d305b06..956cfce 100644
>> --- a/src/storage/storage_backend_fs.c
>> +++ b/src/storage/storage_backend_fs.c
>> @@ -503,7 +503,7 @@ virStorageBackendFileSystemCheck(virConnectPtr conn ATTRIBUTE_UNUSED,
>> {
>> *isActive = false;
>> if (pool->def->type == VIR_STORAGE_POOL_DIR) {
>> - if (access(pool->def->target.path, F_OK) == 0)
>> + if (virFileExists(pool->def->target.path))
>> *isActive = true;
>
> Why didn't you use the same (nicer) way here, when you used it
> everywhere else. I'm talking about '*isActive = virFileExists(...)'.
>
> ACK either way, looking forward to [12]/3 ;-)
>
> Martin
>
> P.S.: If you'll need the answer urgently, ping me and I'll see them in
> the archives.
>
I cleaned up the part you've pointed out and pushed this patch.
Thanks
Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130916/4069f49a/attachment-0001.sig>
More information about the libvir-list
mailing list