@@ -4998,7 +4998,7 @@ ntsa::Error reportInfoProcNetTcp(bsl::vector<ntsa::SocketInfo>* result,
4998
4998
4999
4999
FILE* file = bsl::fopen (fileName, " r" );
5000
5000
if (file == 0 ) {
5001
- error = ntsa::Error (bsl::ferror (file) );
5001
+ error = ntsa::Error (errno );
5002
5002
BSLS_LOG_ERROR (" Failed to open '%s': %s" ,
5003
5003
fileName,
5004
5004
error.text ().c_str ());
@@ -5008,7 +5008,8 @@ ntsa::Error reportInfoProcNetTcp(bsl::vector<ntsa::SocketInfo>* result,
5008
5008
char line[256 ];
5009
5009
5010
5010
if (bsl::fgets (line, sizeof (line), file) == 0 ) {
5011
- error = ntsa::Error (bsl::ferror (file));
5011
+ error = bsl::ferror (file) ? ntsa::Error (errno)
5012
+ : ntsa::Error (ntsa::Error::e_EOF);
5012
5013
BSLS_LOG_ERROR (" Failed to read '%s': "
5013
5014
" failed to read header line: %s" ,
5014
5015
fileName,
@@ -5061,7 +5062,7 @@ ntsa::Error reportInfoProcNetUdp(bsl::vector<ntsa::SocketInfo>* result,
5061
5062
5062
5063
FILE* file = bsl::fopen (fileName, " r" );
5063
5064
if (file == 0 ) {
5064
- error = ntsa::Error (bsl::ferror (file) );
5065
+ error = ntsa::Error (errno );
5065
5066
BSLS_LOG_ERROR (" Failed to open '%s': %s" ,
5066
5067
fileName,
5067
5068
error.text ().c_str ());
@@ -5071,7 +5072,8 @@ ntsa::Error reportInfoProcNetUdp(bsl::vector<ntsa::SocketInfo>* result,
5071
5072
char line[256 ];
5072
5073
5073
5074
if (bsl::fgets (line, sizeof (line), file) == 0 ) {
5074
- error = ntsa::Error (bsl::ferror (file));
5075
+ error = bsl::ferror (file) ? ntsa::Error (errno)
5076
+ : ntsa::Error (ntsa::Error::e_EOF);
5075
5077
BSLS_LOG_ERROR (" Failed to read '%s': "
5076
5078
" failed to read header line: %s" ,
5077
5079
fileName,
0 commit comments