

fseek() returns 0 on success and -1 on error; however our wrapper returns like
lseek(). This patch fixes it and make the wrapper, jfseek(), behave correctly.



---

 cur-root/ansi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -puN ansi.c~jfseek_return ansi.c
--- cur/ansi.c~jfseek_return	2004-06-03 00:59:33.906694480 -0300
+++ cur-root/ansi.c	2004-06-03 01:00:58.526830264 -0300
@@ -181,7 +181,11 @@ int jfseek(struct jfs *stream, long offs
 	pos = lseek(stream->fd, offset, whence);
 	pthread_mutex_unlock(&(stream->lock));
 
-	return pos;
+	/* fseek returns 0 on success, -1 on error */
+	if (pos == -1)
+		return 1;
+
+	return 0;
 }
 
 /* ftell wrapper */

_
