|
|
@ -2,7 +2,7 @@
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <cstring>
|
|
|
|
#include <cstring>
|
|
|
|
#ifdef __LINUX__
|
|
|
|
#ifdef __linux__
|
|
|
|
#include <sys/wait.h>
|
|
|
|
#include <sys/wait.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#include <string>
|
|
|
|
#include <string>
|
|
|
@ -14,7 +14,7 @@ private:
|
|
|
|
int from_shell[2];
|
|
|
|
int from_shell[2];
|
|
|
|
pid_t shell_pid;
|
|
|
|
pid_t shell_pid;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __LINUX__
|
|
|
|
#ifdef __linux__
|
|
|
|
void setNonBlocking(int fd) {
|
|
|
|
void setNonBlocking(int fd) {
|
|
|
|
int flags = fcntl(fd, F_GETFL, 0);
|
|
|
|
int flags = fcntl(fd, F_GETFL, 0);
|
|
|
|
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
|
|
|
|
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
|
|
|
|