aboutsummaryrefslogtreecommitdiff
path: root/winsup/testsuite
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-02-27 23:01:10 +0000
committerChristopher Faylor <me@cgf.cx>2002-02-27 23:01:10 +0000
commit27d01a721763529eca79f7a1b336a874b2350fe9 (patch)
treec33e8d1f324b0a30bf637d97eca4fd65039be0fb /winsup/testsuite
parent9737b9b4de4388d90bdc3e202e8145033fa60b85 (diff)
downloadnewlib-27d01a721763529eca79f7a1b336a874b2350fe9.zip
newlib-27d01a721763529eca79f7a1b336a874b2350fe9.tar.gz
newlib-27d01a721763529eca79f7a1b336a874b2350fe9.tar.bz2
* winsup.api/systemcall.c (main): Ensure that stdin is redirected.
Diffstat (limited to 'winsup/testsuite')
-rw-r--r--winsup/testsuite/ChangeLog4
-rw-r--r--winsup/testsuite/winsup.api/systemcall.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/winsup/testsuite/ChangeLog b/winsup/testsuite/ChangeLog
index dcc9f0a..c5fcd94 100644
--- a/winsup/testsuite/ChangeLog
+++ b/winsup/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2002-02-27 Christopher Faylor <cgf@redhat.com>
+
+ * winsup.api/systemcall.c (main): Ensure that stdin is redirected.
+
2001-11-18 Egor Duda <deo@logos-m.ru>
* winsup.api/pthread/condvar3_1.c: Fix debugging output.
diff --git a/winsup/testsuite/winsup.api/systemcall.c b/winsup/testsuite/winsup.api/systemcall.c
index c9a3483..026f430 100644
--- a/winsup/testsuite/winsup.api/systemcall.c
+++ b/winsup/testsuite/winsup.api/systemcall.c
@@ -10,6 +10,13 @@ main (int argc, char **argv)
int fds[2];
static char buf[4096];
+ close (0);
+ if ((fd = open ("/dev/null", O_WRONLY)) != 0)
+ {
+ fprintf (stderr, "couldn't redirect stdin to /dev/null, fd %d - %s\n", fd, strerror ());
+ exit (1);
+ }
+
close (1);
if ((fd = open ("/dev/null", O_WRONLY)) != 1)
{