+2003-02-11 Ranjit Mathew <rmathew@hotmail.com>
+
+ * java/io/natFileDescriptorWin32.cc
+ (java::io::FileDescriptor::read): Return -1 (EOF) if ReadFile( )
+ returns with Win32 error code ERROR_BROKEN_PIPE.
+
2003-02-11 Michael Koch <konqueror@gmx.de>
* Makefile.in
// natFileDescriptorWin32.cc - Native part of FileDescriptor class.
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+ Foundation, Inc.
This file is part of libgcj.
DWORD read;
if (! ReadFile ((HANDLE)fd, &buf, 1, &read, NULL))
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ {
+ if (GetLastError () == ERROR_BROKEN_PIPE)
+ return -1;
+ else
+ throw new IOException (JvNewStringLatin1 (winerr ()));
+ }
+
if (! read)
return -1;
else
DWORD read;
if (! ReadFile((HANDLE)fd, bytes, count, &read, NULL))
- throw new IOException (JvNewStringLatin1 (winerr ()));
+ {
+ if (GetLastError () == ERROR_BROKEN_PIPE)
+ return -1;
+ else
+ throw new IOException (JvNewStringLatin1 (winerr ()));
+ }
if (read == 0) return -1;
+
return (jint)read;
}