/*
- * Copyright 2012 Facebook, Inc.
+ * Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "folly/Conv.h"
#include "folly/ScopeGuard.h"
#include "folly/String.h"
-#include "folly/experimental/io/Cursor.h"
+#include "folly/io/Cursor.h"
extern char** environ;
}
namespace {
-void setNonBlocking(int fd) {
- int flags = ::fcntl(fd, F_GETFL);
- checkUnixError(flags, "fcntl");
- int r = ::fcntl(fd, F_SETFL, flags | O_NONBLOCK);
- checkUnixError(r, "fcntl");
-}
std::pair<const uint8_t*, size_t> queueFront(const IOBufQueue& queue) {
auto* p = queue.front();
IOBufQueue data) {
std::pair<IOBufQueue, IOBufQueue> out;
- auto readCallback = [&] (int pfd, int cfd) {
+ auto readCallback = [&] (int pfd, int cfd) -> bool {
if (cfd == 1 && flags.readStdout_) {
return handleRead(pfd, out.first);
} else if (cfd == 2 && flags.readStderr_) {
}
};
- auto writeCallback = [&] (int pfd, int cfd) {
+ auto writeCallback = [&] (int pfd, int cfd) -> bool {
if (cfd == 0 && flags.writeStdin_) {
return handleWrite(pfd, data);
} else {