Created
September 16, 2020 09:00
-
-
Save chromabox/61404314887e61c1c32e325a6dc37e41 to your computer and use it in GitHub Desktop.
barrier 2.3.3でbarrierc を daemon指定した時に落ちるバグのFixをしたパッチ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 21a7ac68eec90c064bcb5419c30e6caefe5ed1eb Mon Sep 17 00:00:00 2001 | |
From: localuser <localuser@localdomain> | |
Date: Wed, 16 Sep 2020 12:44:07 +0900 | |
Subject: [PATCH] Fix daemon mode execute missing | |
--- | |
src/lib/base/NonBlockingStream.cpp | 20 ++------------------ | |
1 file changed, 2 insertions(+), 18 deletions(-) | |
diff --git a/src/lib/base/NonBlockingStream.cpp b/src/lib/base/NonBlockingStream.cpp | |
index d44add15..c95caabe 100644 | |
--- a/src/lib/base/NonBlockingStream.cpp | |
+++ b/src/lib/base/NonBlockingStream.cpp | |
@@ -28,32 +28,16 @@ | |
NonBlockingStream::NonBlockingStream(int fd) : | |
_fd(fd) | |
{ | |
- // disable ICANON & ECHO so we don't have to wait for a newline | |
- // before we get data (and to keep it from being echoed back out) | |
- termios ta; | |
- tcgetattr(fd, &ta); | |
- _p_ta_previous = new termios(ta); | |
- ta.c_lflag &= ~(ICANON | ECHO); | |
- tcsetattr(fd, TCSANOW, &ta); | |
- | |
- // prevent IO from blocking so we can poll (read()) | |
- int _cntl_previous = fcntl(fd, F_GETFL); | |
- fcntl(fd, F_SETFL, _cntl_previous | O_NONBLOCK); | |
+ // DISABLE non blocking stream | |
+ // daemon mode happen bug (HAPPEN SIGABRT) | |
} | |
NonBlockingStream::~NonBlockingStream() | |
{ | |
- tcsetattr(_fd, TCSANOW, _p_ta_previous); | |
- fcntl(_fd, F_SETFL, _cntl_previous); | |
- delete _p_ta_previous; | |
} | |
bool NonBlockingStream::try_read_char(char &ch) const | |
{ | |
- int result = read(_fd, &ch, 1); | |
- if (result == 1) | |
- return true; | |
- assert(result == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)); | |
return false; | |
} | |
-- | |
2.17.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment