[Openvas-commits] r3244 - trunk/winslad
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed May 6 02:25:39 CEST 2009
Author: doj
Date: 2009-05-06 02:25:39 +0200 (Wed, 06 May 2009)
New Revision: 3244
Modified:
trunk/winslad/client.cpp
Log:
add RUNTIME output
Modified: trunk/winslad/client.cpp
===================================================================
--- trunk/winslad/client.cpp 2009-05-06 00:21:37 UTC (rev 3243)
+++ trunk/winslad/client.cpp 2009-05-06 00:25:39 UTC (rev 3244)
@@ -437,12 +437,12 @@
}
// print START timestamp to result file
+ const time_t start_t=time(NULL);
{
- time_t t=time(NULL);
- char *ts=asctime(localtime(&t));
+ char *ts=asctime(localtime(&start_t));
ts[strlen(ts)-1]=0; // remove newline character
char buf[256];
- _snprintf(buf, sizeof(buf), "START %s = %s (%u)\r\r\n", pluginName.c_str(), ts, static_cast<unsigned>(t));
+ _snprintf(buf, sizeof(buf), "START %s = %s (%u)\r\n", pluginName.c_str(), ts, static_cast<unsigned>(start_t));
DWORD written;
if(!WriteFile(result_h, buf, strlen(buf), &written, NULL))
{
@@ -502,11 +502,11 @@
// print END timestamp to result file
{
- time_t t=time(NULL);
- char *ts=asctime(localtime(&t));
+ const time_t end_t=time(NULL);
+ char *ts=asctime(localtime(&end_t));
ts[strlen(ts)-1]=0; // remove newline character
- char buf[256];
- _snprintf(buf, sizeof(buf), "\r\r\nEND %s = %s (%u)\r\r\n", pluginName.c_str(), ts, static_cast<unsigned>(t));
+ char buf[512];
+ _snprintf(buf, sizeof(buf), "\r\nEND %s = %s (%u)\r\nRUNTIME %s = %u seconds\r\n", pluginName.c_str(), ts, static_cast<unsigned>(end_t), pluginName.c_str(), static_cast<unsigned>(end_t-start_t));
DWORD written;
if(!WriteFile(result_h, buf, strlen(buf), &written, NULL))
{
More information about the Openvas-commits
mailing list