Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64742 - sandbox/SOC/2010/process/libs/process/test/util
From: boris_at_[hidden]
Date: 2010-08-11 12:06:00


Author: bschaeling
Date: 2010-08-11 12:05:40 EDT (Wed, 11 Aug 2010)
New Revision: 64742
URL: http://svn.boost.org/trac/boost/changeset/64742

Log:
Patched POSIX code to test STDIN with dummy behavior
Text files modified:
   sandbox/SOC/2010/process/libs/process/test/util/helpers.cpp | 6 +++---
   1 files changed, 3 insertions(+), 3 deletions(-)

Modified: sandbox/SOC/2010/process/libs/process/test/util/helpers.cpp
==============================================================================
--- sandbox/SOC/2010/process/libs/process/test/util/helpers.cpp (original)
+++ sandbox/SOC/2010/process/libs/process/test/util/helpers.cpp 2010-08-11 12:05:40 EDT (Wed, 11 Aug 2010)
@@ -91,9 +91,9 @@
 int h_is_nul_stdin(int argc, char *argv[])
 {
 #if defined(BOOST_POSIX_API)
- std::string word;
- std::cin >> word;
- return std::cin.eof() ? EXIT_FAILURE : EXIT_SUCCESS;
+ char buffer[1];
+ int res = read(STDIN_FILENO, &buffer, 1);
+ return res != -1 ? EXIT_SUCCESS : EXIT_FAILURE;
 #elif defined(BOOST_WINDOWS_API)
     HANDLE h = GetStdHandle(STD_INPUT_HANDLE);
     if (h == INVALID_HANDLE_VALUE)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk