Commit 51532731 by Tom Tromey Committed by Tom Tromey

natFileDescriptorEcos.cc (init): Don't use GetStdHandle.

	* java/io/natFileDescriptorEcos.cc (init): Don't use
	GetStdHandle.
	* java/io/natFileDescriptorPosix.cc (valid): Don't call stat if FD
	is negative.
	(init): Don't use GetStdHandle.

From-SVN: r50383
parent fd7852b3
2002-03-06 Tom Tromey <tromey@redhat.com>
* java/io/natFileDescriptorEcos.cc (init): Don't use
GetStdHandle.
* java/io/natFileDescriptorPosix.cc (valid): Don't call stat if FD
is negative.
(init): Don't use GetStdHandle.
* include/config.h.in: Rebuilt.
* configure: Rebuilt.
* Makefile.in: Rebuilt.
......
// natFileDescriptor.cc - Native part of FileDescriptor class.
/* Copyright (C) 1998, 1999, 2001 Free Software Foundation
/* Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation
This file is part of libgcj.
......@@ -44,9 +44,9 @@ diag_write (char *data, int len)
void
java::io::FileDescriptor::init(void)
{
in = new java::io::FileDescriptor((jint)(GetStdHandle (0)));
out = new java::io::FileDescriptor((jint)(GetStdHandle (1)));
err = new java::io::FileDescriptor((jint)(GetStdHandle (2)));
in = new java::io::FileDescriptor(0);
out = new java::io::FileDescriptor(1);
err = new java::io::FileDescriptor(2);
}
jboolean
......
// natFileDescriptor.cc - Native part of FileDescriptor class.
/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation
This file is part of libgcj.
......@@ -46,18 +46,18 @@ details. */
#define NO_FSYNC_MESSAGE "sync unsupported"
void
java::io::FileDescriptor::init(void)
java::io::FileDescriptor::init (void)
{
in = new java::io::FileDescriptor((jint)(GetStdHandle (0)));
out = new java::io::FileDescriptor((jint)(GetStdHandle (1)));
err = new java::io::FileDescriptor((jint)(GetStdHandle (2)));
in = new java::io::FileDescriptor(0);
out = new java::io::FileDescriptor(1);
err = new java::io::FileDescriptor(2);
}
jboolean
java::io::FileDescriptor::valid (void)
{
struct stat sb;
return ::fstat (fd, &sb) == 0;
return fd >= 0 && ::fstat (fd, &sb) == 0;
}
void
......
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