From 6e97eb8ff299bce35c322189d2374e6fcffcf874 Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Sun, 6 Aug 2017 20:33:07 +0200
Subject: [PATCH] use existing fail_fd descriptor value FAIL_FD

---
 alib2std/src/extensions/fdstream.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/alib2std/src/extensions/fdstream.cpp b/alib2std/src/extensions/fdstream.cpp
index ed7b0f16cc..8a5abe1637 100644
--- a/alib2std/src/extensions/fdstream.cpp
+++ b/alib2std/src/extensions/fdstream.cpp
@@ -83,7 +83,7 @@ fdaccessor::fdaccessor ( int new_fd, int fallback_fd ) {
 		fd = fallback_fd;
 		redirected = false;
 	} else {
-		fd = -1;
+		fd = FAIL_FD;
 		redirected = false;
 	}
 }
@@ -99,7 +99,7 @@ bool fdaccessor::is_redirected ( ) const {
 ofdstream::ofdstream ( int fd, int fallback_fd ) : fda ( fd, fallback_fd ), fdbuf ( fda.get_fd ( ) ) {
 	this->init ( & fdbuf );
 
-	if ( fda.get_fd ( ) == -1 )
+	if ( fda.get_fd ( ) == FAIL_FD )
 		setstate ( ios_base::failbit );
 }
 
@@ -113,7 +113,7 @@ bool ofdstream::is_redirected ( ) const {
 ifdstream::ifdstream ( int fd, int fallback_fd ) : fda ( fd, fallback_fd ), fdbuf ( fda.get_fd ( ) ) {
 	this->init ( & fdbuf );
 
-	if ( fda.get_fd ( ) == -1 )
+	if ( fda.get_fd ( ) == FAIL_FD )
 		setstate ( ios_base::failbit );
 }
 
-- 
GitLab