[libvirt] [PATCH] Reduce code duplication in virFileMakePath(Helper)
Eric Blake
eblake at redhat.com
Wed Jul 6 14:05:40 UTC 2011
On 07/06/2011 08:04 AM, Matthias Bolte wrote:
> 2011/7/6 Eric Blake <eblake at redhat.com>:
>> On 07/06/2011 07:47 AM, Matthias Bolte wrote:
>>> Move stat and mkdir to virFileMakePathHelper.
>>>
>>> Also use the stat result to detect whether the existing path
>>> is a directory and set errno accordingly if it's not.
>>> ---
>>> src/util/util.c | 44 ++++++++++++++------------------------------
>>> 1 files changed, 14 insertions(+), 30 deletions(-)
>>
>> ACK with one nit:
>>
>>> - if ((parent = strdup(path)) == NULL) {
>>> + if ((tmp = strdup(path)) == NULL) {
>>> errno = ENOMEM;
>>
>> strdup() already sets errno to ENOMEM on failure, so this line can be
>> deleted.
>
> Removed that line and pushed, thanks.
Shoot. I just realized that mingw does _not_ set errno on strdup
failure; to get that, we need to import the gnulib module strdup-posix.
I'll amend my pending gnulib update patch for yet another mingw
workaround...
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110706/2bc7cd5b/attachment-0001.sig>
More information about the libvir-list
mailing list