diff options
Diffstat (limited to 'cpp/src/tests/ForkedBroker.h')
-rw-r--r-- | cpp/src/tests/ForkedBroker.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/tests/ForkedBroker.h b/cpp/src/tests/ForkedBroker.h index 07e69a0735..cc8714bf23 100644 --- a/cpp/src/tests/ForkedBroker.h +++ b/cpp/src/tests/ForkedBroker.h @@ -85,7 +85,10 @@ class ForkedBroker { ::close(pipeFds[1]); FILE* f = ::fdopen(pipeFds[0], "r"); if (!f) throw ErrnoException("fopen failed"); - if (::fscanf(f, "%d", &port) != 1) throw ErrnoException("ill-formatted port"); + if (::fscanf(f, "%d", &port) != 1) { + if (ferror(f)) throw ErrnoException("Error reading port number from child."); + else throw qpid::Exception("EOF reading port number from child."); + } } else { // child ::close(pipeFds[0]); |