summaryrefslogtreecommitdiff
path: root/libnetfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-01-30 19:15:27 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-01-30 19:15:27 +0000
commit95d27779ef46e2406d92c0361f1dc47a0185ed12 (patch)
tree0dd8dae9601d321269eada2f723cf87062a055ee /libnetfs
parent18a1a4359b299064649f59516a61288f003d3ec5 (diff)
entered into RCS
Diffstat (limited to 'libnetfs')
-rw-r--r--libnetfs/dir-readdir.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libnetfs/dir-readdir.c b/libnetfs/dir-readdir.c
index 7b55a2cc..85719302 100644
--- a/libnetfs/dir-readdir.c
+++ b/libnetfs/dir-readdir.c
@@ -18,6 +18,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
+#include <fcntl.h>
+
#include "netfs.h"
#include "fs_S.h"
@@ -39,14 +41,15 @@ netfs_S_dir_readdir (struct protid *user,
np = user->po->np;
mutex_lock (&np->lock);
+ err = 0;
if ((user->po->openstat & O_READ) == 0)
err = EBADF;
if (!err)
- err = netfs_validate_stat (user->credential, np);
- if (!err && (np->dn_stat.st_mode & S_IFMT) != S_IFDIR)
+ err = netfs_validate_stat (np, user->credential);
+ if (!err && (np->nn_stat.st_mode & S_IFMT) != S_IFDIR)
err = ENOTDIR;
if (!err)
- err = netfs_get_directs (user->credential, np, entry, nentries, data,
+ err = netfs_get_dirents (user->credential, np, entry, nentries, data,
datacnt, bufsiz, amt);
mutex_unlock (&np->lock);
return err;