diff options
author | Michael I. Bushnell <mib@gnu.org> | 1996-01-30 19:15:27 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1996-01-30 19:15:27 +0000 |
commit | 95d27779ef46e2406d92c0361f1dc47a0185ed12 (patch) | |
tree | 0dd8dae9601d321269eada2f723cf87062a055ee /libnetfs | |
parent | 18a1a4359b299064649f59516a61288f003d3ec5 (diff) |
entered into RCS
Diffstat (limited to 'libnetfs')
-rw-r--r-- | libnetfs/dir-readdir.c | 9 |
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; |