diff options
author | Christopher Faylor <me@cgf.cx> | 2002-02-27 23:01:10 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-02-27 23:01:10 +0000 |
commit | 27d01a721763529eca79f7a1b336a874b2350fe9 (patch) | |
tree | c33e8d1f324b0a30bf637d97eca4fd65039be0fb | |
parent | 9737b9b4de4388d90bdc3e202e8145033fa60b85 (diff) | |
download | cygnal-27d01a721763529eca79f7a1b336a874b2350fe9.tar.gz cygnal-27d01a721763529eca79f7a1b336a874b2350fe9.tar.bz2 cygnal-27d01a721763529eca79f7a1b336a874b2350fe9.zip |
* winsup.api/systemcall.c (main): Ensure that stdin is redirected.
-rw-r--r-- | winsup/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/testsuite/winsup.api/systemcall.c | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/winsup/testsuite/ChangeLog b/winsup/testsuite/ChangeLog index dcc9f0a04..c5fcd9447 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 c9a34832f..026f430ff 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) { |