Merge "adb: Mask SIGTTIN so that I/O works when backgrounded."
am: 69ccb9532c
* commit '69ccb9532cb822685d27142a5117d881be21ab01':
adb: Mask SIGTTIN so that I/O works when backgrounded.
This commit is contained in:
commit
04c64dba9f
|
@ -39,6 +39,7 @@
|
|||
#include <base/strings.h>
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#include <signal.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -440,6 +441,14 @@ static void* stdin_read_thread(void* x) {
|
|||
|
||||
adb_thread_setname("stdin reader");
|
||||
|
||||
#ifndef __WIN32
|
||||
// Mask SIGTTIN in case we're in a backgrounded process
|
||||
sigset_t sigset;
|
||||
sigemptyset(&sigset);
|
||||
sigaddset(&sigset, SIGTTIN);
|
||||
pthread_sigmask(SIG_BLOCK, &sigset, nullptr);
|
||||
#endif
|
||||
|
||||
char raw_buffer[1024];
|
||||
char* buffer_ptr = raw_buffer;
|
||||
size_t buffer_size = sizeof(raw_buffer);
|
||||
|
|
Loading…
Reference in New Issue