aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2017-12-25 02:19:17 +0100
committerMihai Moldovan <ionic@ionic.de>2017-12-25 04:00:36 +0100
commit970704ca404b8f47f929154cf4eade1019ff8ebb (patch)
treee1425364cfc8ce7fad08decee29d1b0968ea498f
parentfe447bb6d26dceff743797548d24e3b854e3a104 (diff)
downloadnx-libs-970704ca404b8f47f929154cf4eade1019ff8ebb.tar.gz
nx-libs-970704ca404b8f47f929154cf4eade1019ff8ebb.tar.bz2
nx-libs-970704ca404b8f47f929154cf4eade1019ff8ebb.zip
nxcomp/src/Loop.cpp: use new log continuation mechanism.
Especially don't flush data out mid-append. Doing so will lead to the next append operation failing. Should fix messages queuing up indefinitely (until they are discarded at program termination, at least) and missing messages in general. Fixes: ArcticaProject/nx-libs#577 Fixes: ArcticaProject/nx-libs#611
-rw-r--r--nxcomp/src/Loop.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp
index b88615467..cfa175bd3 100644
--- a/nxcomp/src/Loop.cpp
+++ b/nxcomp/src/Loop.cpp
@@ -13449,12 +13449,12 @@ int ParseArg(const char *type, const char *name, const char *value)
case 'm':
case 'g':
{
- nxinfo << (char) toupper(*id);
+ nxinfo_append << (char) toupper(*id);
break;
}
}
- nxinfo << ".\n" << std::flush;
+ nxinfo_append << ".\n" << std::flush;
double result = atof(string) * base;
@@ -14028,13 +14028,13 @@ static void handleCheckSelectInLoop(int &setFDs, fd_set &readSet,
{
i = 0;
- nxinfo << "Loop: Selected for read are ";
+ nxinfo << "Loop: Selected for read are";
for (int j = 0; j < setFDs; j++)
{
if (FD_ISSET(j, &readSet))
{
- nxinfo << "[" << j << "]" << std::flush;
+ nxinfo_append << " [" << j << "]";
i++;
}
@@ -14042,22 +14042,22 @@ static void handleCheckSelectInLoop(int &setFDs, fd_set &readSet,
if (i > 0)
{
- nxinfo << ".\n" << std::flush;
+ nxinfo_append << ".\n" << std::flush;
}
else
{
- nxinfo << "[none].\n" << std::flush;
+ nxinfo_append << "[none].\n" << std::flush;
}
i = 0;
- nxinfo << "Loop: Selected for write are ";
+ nxinfo << "Loop: Selected for write are";
for (int j = 0; j < setFDs; j++)
{
if (FD_ISSET(j, &writeSet))
{
- nxinfo << "[" << j << "]" << std::flush;
+ nxinfo_append << " [" << j << "]";
i++;
}
@@ -14065,11 +14065,11 @@ static void handleCheckSelectInLoop(int &setFDs, fd_set &readSet,
if (i > 0)
{
- nxinfo << ".\n" << std::flush;
+ nxinfo_append << ".\n" << std::flush;
}
else
{
- nxinfo << "[none].\n" << std::flush;
+ nxinfo_append << "[none].\n" << std::flush;
}
}
@@ -14109,13 +14109,13 @@ static void handleCheckResultInLoop(int &resultFDs, int &errorFDs, int &setFDs,
{
i = 0;
- nxinfo << "Loop: Selected for read are ";
+ nxinfo << "Loop: Selected for read are";
for (int j = 0; j < setFDs; j++)
{
if (FD_ISSET(j, &readSet))
{
- nxinfo << "[" << j << "]" << std::flush;
+ nxinfo_append << " [" << j << "]";
i++;
}
@@ -14123,22 +14123,22 @@ static void handleCheckResultInLoop(int &resultFDs, int &errorFDs, int &setFDs,
if (i > 0)
{
- nxinfo << ".\n" << std::flush;
+ nxinfo_append << ".\n" << std::flush;
}
else
{
- nxinfo << "[none].\n" << std::flush;
+ nxinfo_append << "[none].\n" << std::flush;
}
i = 0;
- nxinfo << "Loop: Selected for write are ";
+ nxinfo << "Loop: Selected for write are";
for (int j = 0; j < setFDs; j++)
{
if (FD_ISSET(j, &writeSet))
{
- nxinfo << "[" << j << "]" << std::flush;
+ nxinfo_append << " [" << j << "]";
i++;
}
@@ -14146,11 +14146,11 @@ static void handleCheckResultInLoop(int &resultFDs, int &errorFDs, int &setFDs,
if (i > 0)
{
- nxinfo << ".\n" << std::flush;
+ nxinfo_append << ".\n" << std::flush;
}
else
{
- nxinfo << "[none].\n" << std::flush;
+ nxinfo_append << "[none].\n" << std::flush;
}
}
}