Commit 5e18b3d6 by Tom Tromey Committed by Tom Tromey

re PR libgcj/9934 (Bugs in natFileDescriptorPosix.cc:available())

	PR libgcj/9934:
	* java/io/natFileDescriptorPosix.cc (available): Fixed arguments
	to lseek.  Return 0 if we can't compute the value.

From-SVN: r64053
parent 95dca20c
2003-03-09 Tom Tromey <tromey@redhat.com>
PR libgcj/9934:
* java/io/natFileDescriptorPosix.cc (available): Fixed arguments
to lseek. Return 0 if we can't compute the value.
2003-03-03 Michael Koch <konqueror@gmx.de> 2003-03-03 Michael Koch <konqueror@gmx.de>
* java/net/NetworkInterface.java: Merged with classpath. * java/net/NetworkInterface.java: Merged with classpath.
......
...@@ -371,7 +371,7 @@ java::io::FileDescriptor::available (void) ...@@ -371,7 +371,7 @@ java::io::FileDescriptor::available (void)
off_t where = 0; off_t where = 0;
if (fstat (fd, &sb) != -1 if (fstat (fd, &sb) != -1
&& S_ISREG (sb.st_mode) && S_ISREG (sb.st_mode)
&& (where = lseek (fd, SEEK_CUR, 0)) != (off_t) -1) && (where = lseek (fd, 0, SEEK_CUR)) != (off_t) -1)
{ {
num = (long) (sb.st_size - where); num = (long) (sb.st_size - where);
num_set = true; num_set = true;
...@@ -397,6 +397,6 @@ java::io::FileDescriptor::available (void) ...@@ -397,6 +397,6 @@ java::io::FileDescriptor::available (void)
return (jint) num; return (jint) num;
#else #else
throw new IOException (JvNewStringLatin1 ("unimplemented")); return 0;
#endif #endif
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment