[Pkg-owncloud-commits] [owncloud-client] 282/498: vio_local: Simplify and fix the error out behaviour of win32 impl.

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:58 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 4cb78999d2326289deff1d5063e428656c7bcdc4
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Tue Jul 7 21:05:08 2015 +0200

    vio_local: Simplify and fix the error out behaviour of win32 impl.
    
    This avoids leaking of a stat struct in error case.
---
 csync/src/vio/csync_vio_local.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/csync/src/vio/csync_vio_local.c b/csync/src/vio/csync_vio_local.c
index 70dd5ac..39f2c00 100644
--- a/csync/src/vio/csync_vio_local.c
+++ b/csync/src/vio/csync_vio_local.c
@@ -150,12 +150,9 @@ csync_vio_file_stat_t *csync_vio_local_readdir(csync_vio_handle_t *dhandle) {
           // might be error, check!
           int dwError = GetLastError();
           if (dwError != ERROR_NO_MORE_FILES) {
-              errno = EACCES; // FIXME: Is this a good errno?
-              goto err;
-          } else {
-              // Normal case that no more is in the dir.
-              return NULL;
+              errno = EACCES; // no more files is fine. Otherwise EACCESS
           }
+          goto err;
       }
   }
   file_stat->name = c_utf8_from_locale(handle->ffd.cFileName);
@@ -171,11 +168,7 @@ csync_vio_file_stat_t *csync_vio_local_readdir(csync_vio_handle_t *dhandle) {
 
   dirent = _treaddir(handle->dh);
   if (dirent == NULL) {
-    if (errno) {
       goto err;
-    } else {
-      return NULL;
-    }
   }
   file_stat->name = c_utf8_from_locale(dirent->d_name);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list