Skip to content
Snippets Groups Projects
Commit 6e97eb8f authored by Jan Trávníček's avatar Jan Trávníček
Browse files

use existing fail_fd descriptor value FAIL_FD

parent 1a07d60a
No related branches found
No related tags found
No related merge requests found
...@@ -83,7 +83,7 @@ fdaccessor::fdaccessor ( int new_fd, int fallback_fd ) { ...@@ -83,7 +83,7 @@ fdaccessor::fdaccessor ( int new_fd, int fallback_fd ) {
fd = fallback_fd; fd = fallback_fd;
redirected = false; redirected = false;
} else { } else {
fd = -1; fd = FAIL_FD;
redirected = false; redirected = false;
} }
} }
...@@ -99,7 +99,7 @@ bool fdaccessor::is_redirected ( ) const { ...@@ -99,7 +99,7 @@ bool fdaccessor::is_redirected ( ) const {
ofdstream::ofdstream ( int fd, int fallback_fd ) : fda ( fd, fallback_fd ), fdbuf ( fda.get_fd ( ) ) { ofdstream::ofdstream ( int fd, int fallback_fd ) : fda ( fd, fallback_fd ), fdbuf ( fda.get_fd ( ) ) {
this->init ( & fdbuf ); this->init ( & fdbuf );
   
if ( fda.get_fd ( ) == -1 ) if ( fda.get_fd ( ) == FAIL_FD )
setstate ( ios_base::failbit ); setstate ( ios_base::failbit );
} }
   
...@@ -113,7 +113,7 @@ bool ofdstream::is_redirected ( ) const { ...@@ -113,7 +113,7 @@ bool ofdstream::is_redirected ( ) const {
ifdstream::ifdstream ( int fd, int fallback_fd ) : fda ( fd, fallback_fd ), fdbuf ( fda.get_fd ( ) ) { ifdstream::ifdstream ( int fd, int fallback_fd ) : fda ( fd, fallback_fd ), fdbuf ( fda.get_fd ( ) ) {
this->init ( & fdbuf ); this->init ( & fdbuf );
   
if ( fda.get_fd ( ) == -1 ) if ( fda.get_fd ( ) == FAIL_FD )
setstate ( ios_base::failbit ); setstate ( ios_base::failbit );
} }
   
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment