diff options
author | Arne Juul <arnej@verizonmedia.com> | 2021-09-01 20:16:09 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2021-09-01 20:16:09 +0000 |
commit | a72524faf35d35617d143c61e9da4aef53727a50 (patch) | |
tree | bac16c876269877d47f71a79668a06f8c1e47406 /fastos | |
parent | 61fa9a721dcf7009048638b731411ff1f5a1b49d (diff) |
remove helper methods
ReadInt, ReadBytes, WriteInt, WriteBytes are now unused.
Diffstat (limited to 'fastos')
-rw-r--r-- | fastos/src/vespa/fastos/unix_process.cpp | 73 | ||||
-rw-r--r-- | fastos/src/vespa/fastos/unix_process.h | 5 |
2 files changed, 0 insertions, 78 deletions
diff --git a/fastos/src/vespa/fastos/unix_process.cpp b/fastos/src/vespa/fastos/unix_process.cpp index b7358e5adb4..c1a57f0a381 100644 --- a/fastos/src/vespa/fastos/unix_process.cpp +++ b/fastos/src/vespa/fastos/unix_process.cpp @@ -916,79 +916,6 @@ int FastOS_UNIX_Process::BuildStreamMask (bool useShell) return streamMask; } -void FastOS_UNIX_ProcessStarter:: -ReadBytes(int fd, void *buffer, int bytes) -{ - - uint8_t *writePtr = static_cast<uint8_t *>(buffer); - int remaining = bytes; - - while(remaining > 0) - { - int bytesRead; - do - { - bytesRead = read(fd, writePtr, remaining); - } while(bytesRead < 0 && (errno == EINTR)); - - if (bytesRead < 0) { - //perror("FATAL: FastOS_UNIX_ProcessStarter read"); - std::_Exit(1); - } - else if(bytesRead == 0) - { - //fprintf(stderr, "FATAL: FastOS_UNIX_RealProcessStart read 0\n"); - std::_Exit(1); - } - - writePtr += bytesRead; - remaining -= bytesRead; - } -} - -void FastOS_UNIX_ProcessStarter:: -WriteBytes(int fd, const void *buffer, int bytes, bool ignoreFailure) -{ - const uint8_t *readPtr = static_cast<const uint8_t *>(buffer); - int remaining = bytes; - - while(remaining > 0) - { - int bytesWritten; - do { - bytesWritten = write(fd, readPtr, remaining); - } while (bytesWritten < 0 && (errno == EINTR)); - - if (bytesWritten < 0) { - if (ignoreFailure) - return; - //perror("FATAL: FastOS_UNIX_ProcessStarter write"); - std::_Exit(1); - } else if (bytesWritten == 0) { - if (ignoreFailure) - return; - //fprintf(stderr, "FATAL: FastOS_UNIX_RealProcessStart write 0\n"); - std::_Exit(1); - } - - readPtr += bytesWritten; - remaining -= bytesWritten; - } -} - -int FastOS_UNIX_ProcessStarter::ReadInt (int fd) -{ - int intStorage; - ReadBytes(fd, &intStorage, sizeof(int)); - return intStorage; -} - -void FastOS_UNIX_ProcessStarter::WriteInt (int fd, int integer, - bool ignoreFailure) -{ - int intStorage = integer; - WriteBytes(fd, &intStorage, sizeof(int), ignoreFailure); -} void FastOS_UNIX_ProcessStarter:: AddChildProcess (FastOS_UNIX_RealProcess *node) diff --git a/fastos/src/vespa/fastos/unix_process.h b/fastos/src/vespa/fastos/unix_process.h index 7df764b04eb..9d2742c76ef 100644 --- a/fastos/src/vespa/fastos/unix_process.h +++ b/fastos/src/vespa/fastos/unix_process.h @@ -174,11 +174,6 @@ public: protected: FastOS_ApplicationInterface *_app; - static void ReadBytes(int fd, void *buffer, int bytes); - static void WriteBytes(int fd, const void *buffer, - int bytes, bool ignoreFailure = false); - static int ReadInt (int fd); - static void WriteInt (int fd, int integer, bool ignoreFailure = false); FastOS_UNIX_RealProcess *_processList; |