summaryrefslogtreecommitdiffstats
path: root/lib/libstand/fstat.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2004-01-21 20:12:23 +0000
committerjhb <jhb@FreeBSD.org>2004-01-21 20:12:23 +0000
commitfffc52fe7a3393e38603b6d028c721e38a1d1cc3 (patch)
treeef59111118b96cb170e58b13a12c868718248613 /lib/libstand/fstat.c
parentc6b7068a7d44e6082f3cba1e19415d67838013ac (diff)
downloadFreeBSD-src-fffc52fe7a3393e38603b6d028c721e38a1d1cc3.zip
FreeBSD-src-fffc52fe7a3393e38603b6d028c721e38a1d1cc3.tar.gz
Clean up error handling in libstand filesystem code to be more consistent:
- bzipfs and gzipfs now properly return errno values directly from their read routines rather than returning -1. - missing errno values on error returns for the seek routines on almost all filesystems were added. - fstat() now returns -1 if an error occurs rather than ignoring it. - nfs's readdir() routine now reports valid errno values if an error or EOF occurs rather than EPERM (It was just returning 0 for success and 1 for failure). - nullfs used the wrong semantics for every function besides close() and seek(). Getting it right for close() appears to be an accident at that. - read() for buffered files no longer returns 0 (EOF) if an error occurs, but returns -1 instead.
Diffstat (limited to 'lib/libstand/fstat.c')
-rw-r--r--lib/libstand/fstat.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libstand/fstat.c b/lib/libstand/fstat.c
index 3a5f39f..7d95360 100644
--- a/lib/libstand/fstat.c
+++ b/lib/libstand/fstat.c
@@ -59,5 +59,7 @@ fstat(fd, sb)
}
errno = (f->f_ops->fo_stat)(f, sb);
+ if (errno)
+ return (-1);
return (0);
}
OpenPOWER on IntegriCloud