summaryrefslogtreecommitdiff
path: root/src/multilogdevice.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/multilogdevice.cc')
-rw-r--r--src/multilogdevice.cc24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/multilogdevice.cc b/src/multilogdevice.cc
index 612bb33..7452432 100644
--- a/src/multilogdevice.cc
+++ b/src/multilogdevice.cc
@@ -5,26 +5,24 @@
* @date 2003/2023
* --------------------------------------------------------------- **/
#include "multilogdevice.h"
+
#include <string>
-#include <sys/types.h>
+#include <errno.h>
+
#include <sys/select.h>
#include <sys/time.h>
+#include <sys/types.h>
#include <unistd.h>
-#include <errno.h>
using namespace ::std;
using namespace ::Binc;
//------------------------------------------------------------------------
-MultilogDevice::MultilogDevice(int f) : IODevice(f)
-{
-}
+MultilogDevice::MultilogDevice(int f) : IODevice(f) {}
//------------------------------------------------------------------------
-MultilogDevice::~MultilogDevice(void)
-{
-}
+MultilogDevice::~MultilogDevice(void) {}
//------------------------------------------------------------------------
string MultilogDevice::service(void) const
@@ -43,8 +41,7 @@ bool MultilogDevice::waitForWrite(void) const
tv.tv_sec = getTimeout();
tv.tv_usec = 0;
- int result = select(fileno(stderr) + 1, 0, &writeMask,
- 0, tv.tv_sec ? &tv : 0);
+ int result = select(fileno(stderr) + 1, 0, &writeMask, 0, tv.tv_sec ? &tv : 0);
return result > 0;
}
@@ -59,17 +56,16 @@ bool MultilogDevice::waitForRead(void) const
IODevice::WriteResult MultilogDevice::write(void)
{
for (;;) {
- ssize_t wrote = ::write(fileno(stderr), outputBuffer.str().c_str(),
- outputBuffer.getSize());
+ ssize_t wrote = ::write(fileno(stderr), outputBuffer.str().c_str(), outputBuffer.getSize());
if (wrote == -1) {
- if (errno == EINTR)
+ if (errno == EINTR)
continue;
else
return WriteError;
}
- if ((unsigned int) wrote == outputBuffer.getSize()) {
+ if ((unsigned int)wrote == outputBuffer.getSize()) {
outputBuffer.clear();
return WriteDone;
}