From fb6b710c39b8bbefd730af2d2b8704bd646e0456 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 21 Jan 2004 20:12:23 +0000 Subject: 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. --- lib/libstand/ufs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/libstand/ufs.c') diff --git a/lib/libstand/ufs.c b/lib/libstand/ufs.c index 8148fe9943fc..6a3d75849532 100644 --- a/lib/libstand/ufs.c +++ b/lib/libstand/ufs.c @@ -818,6 +818,7 @@ ufs_seek(f, offset, where) fp->f_seekp = DIP(fp, di_size) - offset; break; default: + errno = EINVAL; return (-1); } return (fp->f_seekp); -- cgit v1.3