Re: [libvirt] [PATCH 1/2] util: introduce virDirRead wrapper for readdir

2014-04-22 Thread Natanael Copa
On Mon, 21 Apr 2014 16:05:28 -0600 Eric Blake ebl...@redhat.com wrote: On 04/20/2014 05:53 AM, Natanael Copa wrote: ... +/* return 0 = success, 1 = end-of-dir and -1 = error */ This logic is a bit odd to reason about. I think 1 = success (returned 1 entry), 0 = end-of-dir (successfully

Re: [libvirt] [PATCH 1/2] util: introduce virDirRead wrapper for readdir

2014-04-21 Thread Eric Blake
On 04/20/2014 05:53 AM, Natanael Copa wrote: Introduce a wrapper for readdir. This helps us make sure that we always set errno before calling readdir and it will make sure errors are properly logged. Signed-off-by: Natanael Copa nc...@alpinelinux.org --- src/util/virfile.c | 14

Re: [libvirt] [PATCH 1/2] util: introduce virDirRead wrapper for readdir

2014-04-21 Thread Eric Blake
On 04/21/2014 04:05 PM, Eric Blake wrote: On 04/20/2014 05:53 AM, Natanael Copa wrote: Introduce a wrapper for readdir. This helps us make sure that we always set errno before calling readdir and it will make sure errors are properly logged. There's also the point I raised about whether we

[libvirt] [PATCH 1/2] util: introduce virDirRead wrapper for readdir

2014-04-20 Thread Natanael Copa
Introduce a wrapper for readdir. This helps us make sure that we always set errno before calling readdir and it will make sure errors are properly logged. Signed-off-by: Natanael Copa nc...@alpinelinux.org --- src/util/virfile.c | 14 ++ src/util/virfile.h | 3 +++ 2 files changed,