add util part 4,util/linux,util/unix and modify warns

Signed-off-by: libenyao <libenyao@h-partners.com>
This commit is contained in:
libenyao
2023-03-01 10:49:35 +08:00
parent b0cac1b810
commit 2d33d2a82a
4 changed files with 10 additions and 6 deletions
+4 -2
View File
@@ -13,10 +13,10 @@
* limitations under the License.
*/
#include <thread>
#include "CommandLineInterface.h"
#include "PreviewerEngineLog.h"
#include "WebSocketServer.h"
#include <thread>
using namespace std;
lws* WebSocketServer::webSocket = nullptr;
@@ -96,7 +96,9 @@ void WebSocketServer::sigint_handler(int sig)
void WebSocketServer::StartWebsocketListening()
{
signal(SIGINT, sigint_handler);
if (signal(SIGINT, sigint_handler) == SIG_ERR) {
return;
}
ILOG("Begin to start websocket listening!");
struct lws_context_creation_info contextInfo = {0};
contextInfo.port = serverPort;
+2 -2
View File
@@ -17,7 +17,7 @@
#define WEBSOCKETSERVER_H
#include <thread>
#include <signal.h>
#include <csignal>
#include <mutex>
#include "libwebsockets.h"
@@ -34,7 +34,7 @@ public:
void StartWebsocketListening();
void Run();
size_t WriteData(unsigned char* data, size_t length);
enum WebSocketState { INIT = -1, UNWRITEABLE = 0, WRITEABLE = 1 };
enum class WebSocketState { INIT = -1, UNWRITEABLE = 0, WRITEABLE = 1 };
static WebSocketState webSocketWritable;
static uint8_t* firstImageBuffer;
static uint64_t firstImagebufferSize;
+1 -1
View File
@@ -39,7 +39,7 @@ const string ClipboardX11::GetClipboardData()
int ret = DefaultScreen(display);
window = XCreateSimpleWindow(display, RootWindow(display, ret), 0, 0, 1, 1, 0,
BlackPixel(display, ret), WhitePixel(display, ret));
string retStr;
string retStr; // NOLINT
UTF8 = XInternAtom(display, "UTF8_STRING", True);
if (UTF8 != None) retStr = GetPasteType(UTF8);
if (retStr.empty()) retStr = GetPasteType(XA_STRING);
+3 -1
View File
@@ -28,7 +28,9 @@ using namespace std;
void CrashHandler::InitExceptionHandler()
{
signal(SIGSEGV, ApplicationCrashHandler);
if (signal(SIGSEGV, ApplicationCrashHandler) == SIG_ERR) {
return;
}
}
void CrashHandler::ApplicationCrashHandler(int signal)