aboutsummaryrefslogtreecommitdiffstats
path: root/util/stream/pipe.cpp
diff options
context:
space:
mode:
authoryazevnul <yazevnul@yandex-team.ru>2022-02-10 16:46:48 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:48 +0300
commit9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /util/stream/pipe.cpp
parent8cbc307de0221f84c80c42dcbe07d40727537e2c (diff)
downloadydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/stream/pipe.cpp')
-rw-r--r--util/stream/pipe.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/util/stream/pipe.cpp b/util/stream/pipe.cpp
index ff5b778802..51be1934a7 100644
--- a/util/stream/pipe.cpp
+++ b/util/stream/pipe.cpp
@@ -8,7 +8,7 @@
class TPipeBase::TImpl {
public:
inline TImpl(const TString& command, const char* mode)
- : Pipe_(nullptr)
+ : Pipe_(nullptr)
{
#ifndef _freebsd_
if (strcmp(mode, "r+") == 0) {
@@ -16,13 +16,13 @@ public:
}
#endif
Pipe_ = ::popen(command.data(), mode);
- if (Pipe_ == nullptr) {
+ if (Pipe_ == nullptr) {
ythrow TSystemError() << "failed to open pipe: " << command.Quote();
}
}
inline ~TImpl() {
- if (Pipe_ != nullptr) {
+ if (Pipe_ != nullptr) {
::pclose(Pipe_);
}
}
@@ -44,14 +44,14 @@ TPipeInput::TPipeInput(const TString& command)
}
size_t TPipeInput::DoRead(void* buf, size_t len) {
- if (Impl_->Pipe_ == nullptr) {
+ if (Impl_->Pipe_ == nullptr) {
return 0;
}
size_t bytesRead = ::fread(buf, 1, len, Impl_->Pipe_);
if (bytesRead == 0) {
int exitStatus = ::pclose(Impl_->Pipe_);
- Impl_->Pipe_ = nullptr;
+ Impl_->Pipe_ = nullptr;
if (exitStatus == -1) {
ythrow TSystemError() << "pclose() failed";
} else if (exitStatus != 0) {
@@ -67,14 +67,14 @@ TPipeOutput::TPipeOutput(const TString& command)
}
void TPipeOutput::DoWrite(const void* buf, size_t len) {
- if (Impl_->Pipe_ == nullptr || len != ::fwrite(buf, 1, len, Impl_->Pipe_)) {
+ if (Impl_->Pipe_ == nullptr || len != ::fwrite(buf, 1, len, Impl_->Pipe_)) {
ythrow TSystemError() << "fwrite failed";
}
}
void TPipeOutput::Close() {
int exitStatus = ::pclose(Impl_->Pipe_);
- Impl_->Pipe_ = nullptr;
+ Impl_->Pipe_ = nullptr;
if (exitStatus == -1) {
ythrow TSystemError() << "pclose() failed";
} else if (exitStatus != 0) {