@@ -35,28 +35,29 @@ ReadFull(IOObject &descriptor, size_t length,
3535 if (!descriptor.IsValid ())
3636 return createStringError (" transport output is closed" );
3737
38- SelectHelper sh ;
38+ bool timeout_supported = true ;
3939 // FIXME: SelectHelper does not work with NativeFile on Win32.
4040#if _WIN32
41- if (timeout && descriptor.GetFdType () == eFDTypeSocket)
42- sh.SetTimeout (*timeout);
43- #else
44- if (timeout)
45- sh.SetTimeout (*timeout);
41+ timeout_supported = descriptor.GetFdType () == eFDTypeSocket;
4642#endif
47- sh.FDSetRead (descriptor.GetWaitableHandle ());
48- Status status = sh.Select ();
49- if (status.Fail ()) {
50- // Convert timeouts into a specific error.
51- if (status.GetType () == lldb::eErrorTypePOSIX &&
52- status.GetError () == ETIMEDOUT)
53- return make_error<TimeoutError>();
54- return status.takeError ();
43+
44+ if (timeout && timeout_supported) {
45+ SelectHelper sh;
46+ sh.SetTimeout (*timeout);
47+ sh.FDSetRead (descriptor.GetWaitableHandle ());
48+ Status status = sh.Select ();
49+ if (status.Fail ()) {
50+ // Convert timeouts into a specific error.
51+ if (status.GetType () == lldb::eErrorTypePOSIX &&
52+ status.GetError () == ETIMEDOUT)
53+ return make_error<TimeoutError>();
54+ return status.takeError ();
55+ }
5556 }
5657
5758 std::string data;
5859 data.resize (length);
59- status = descriptor.Read (data.data (), length);
60+ Status status = descriptor.Read (data.data (), length);
6061 if (status.Fail ())
6162 return status.takeError ();
6263
0 commit comments