diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2011-01-20 09:39:16 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2011-01-20 09:39:16 +0000 |
| commit | 9fb9c623a64eb95c4237c39944cf8cdaf7753f64 (patch) | |
| tree | 9bdb53da252c17741e9eee12defafe37d5bb0543 /sys/fs/tmpfs | |
| parent | 1d6334ce30357964cd93cd328317766d7b7155a9 (diff) | |
Notes
Diffstat (limited to 'sys/fs/tmpfs')
| -rw-r--r-- | sys/fs/tmpfs/tmpfs_subr.c | 7 | ||||
| -rw-r--r-- | sys/fs/tmpfs/tmpfs_vnops.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 84a2038112f1..62dd0bf20365 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -827,9 +827,10 @@ tmpfs_dir_getdents(struct tmpfs_node *node, struct uio *uio, off_t *cntp) /* Copy the new dirent structure into the output buffer and * advance pointers. */ error = uiomove(&d, d.d_reclen, uio); - - (*cntp)++; - de = TAILQ_NEXT(de, td_entries); + if (error == 0) { + (*cntp)++; + de = TAILQ_NEXT(de, td_entries); + } } while (error == 0 && uio->uio_resid > 0 && de != NULL); /* Update the offset and cache. */ diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 059a7909104e..a57c1f286ce7 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1349,7 +1349,7 @@ outok: MPASS(error >= -1); if (error == -1) - error = 0; + error = (cnt != 0) ? 0 : EINVAL; if (eofflag != NULL) *eofflag = |
