]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
uclient: align readdirplus_r with readdir_r.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Thu, 27 Oct 2011 23:14:58 +0000 (16:14 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Thu, 27 Oct 2011 23:15:32 +0000 (16:15 -0700)
The only user of this code expects to get 1 on a successfully-filled
value, 0 on a successful non-fill, or -errno otherwise. But the
callback returns -1 to indicate it's already been filled in, which
will happen on every single call to a directory with multiple entries...

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/client/Client.cc

index 52ab716151bf7f841bba9824180610e0678cb97a..e56e2f29e26346a0c6fa1dfe32b34e0b3033eac4 100644 (file)
@@ -4633,7 +4633,7 @@ int Client::readdirplus_r(dir_result_t *d, struct dirent *de, struct stat *st, i
   sr.full = false;
 
   int r = readdir_r_cb(d, _readdir_single_dirent_cb, (void *)&sr);
-  if (r < 0)
+  if (r < -1)
     return r;
   if (sr.full)
     return 1;