[Libreoffice-commits] online.git: 2 commits - loolwsd/test

Tor Lillqvist tml at collabora.com
Mon Apr 25 06:26:25 UTC 2016


 loolwsd/test/httpcrashtest.cpp |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 246e341c66b3bb732b90744824735967cba3ca65
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 25 09:25:23 2016 +0300

    There is a kill() system call

diff --git a/loolwsd/test/httpcrashtest.cpp b/loolwsd/test/httpcrashtest.cpp
index 5e74839..68f8ccc 100644
--- a/loolwsd/test/httpcrashtest.cpp
+++ b/loolwsd/test/httpcrashtest.cpp
@@ -9,6 +9,12 @@
 
 #include "config.h"
 
+#include <errno.h>
+#include <signal.h>
+#include <sys/types.h>
+
+#include <cstring>
+
 #include <Poco/DirectoryIterator.h>
 #include <Poco/Dynamic/Var.h>
 #include <Poco/FileStream.h>
@@ -224,12 +230,9 @@ void HTTPCrashTest::killLoKitProcesses()
                 Poco::StringTokenizer tokens(statString, " ");
                 if (tokens.count() > 3 && tokens[1] == "(loolkit)")
                 {
-                    const std::string killLOKit = "kill -9 " + std::to_string(pid);
-                    std::cerr << "$ " + killLOKit << std::endl;
-                    const auto res = std::system(killLOKit.c_str());
-                    if (res != 0)
+                    if (kill(pid, SIGKILL) == -1)
                     {
-                        std::cerr << "exit " + std::to_string(res) + " from " + killLOKit << std::endl;
+                        std::cerr << "kill(" << pid << ",SIGKILL) failed: " << std::strerror(errno) << std::endl;
                     }
                 }
             }
commit ada503d91e5d044969376c8bc1d6634bacc714ac
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 25 09:15:25 2016 +0300

    Bin unused variable

diff --git a/loolwsd/test/httpcrashtest.cpp b/loolwsd/test/httpcrashtest.cpp
index cc6357f..5e74839 100644
--- a/loolwsd/test/httpcrashtest.cpp
+++ b/loolwsd/test/httpcrashtest.cpp
@@ -188,7 +188,6 @@ void HTTPCrashTest::testCrashKit()
         socket.shutdown();
         // no more messages is received.
         bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
-        std::string received(buffer);
         CPPUNIT_ASSERT_EQUAL(0, bytes);
         CPPUNIT_ASSERT_EQUAL(0, flags);
     }


More information about the Libreoffice-commits mailing list