From a1b6b9ae58c85ec1801935676c9dd76682a313b1 Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期四, 14 一月 2021 11:29:03 +0800
Subject: [PATCH] CMake

---
 src/socket/shm_socket.cpp |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/socket/shm_socket.cpp b/src/socket/shm_socket.cpp
index d094753..0e5e2fb 100644
--- a/src/socket/shm_socket.cpp
+++ b/src/socket/shm_socket.cpp
@@ -52,7 +52,7 @@
   logger->debug("shm_open_socket\n");
   shm_socket_t *socket = (shm_socket_t *)calloc(1, sizeof(shm_socket_t));
   socket->socket_type = socket_type;
-  socket->key = -1;
+  socket->key = 0;
   socket->force_bind = false;
   socket->dispatch_thread = 0;
   socket->status = SHM_CONN_CLOSED;
@@ -127,7 +127,7 @@
 
   int key;
   hashtable_t *hashtable = mm_get_hashtable();
-  if (socket->key == -1) {
+  if (socket->key == 0) {
     key = hashtable_alloc_key(hashtable);
     socket->key = key;
   } else {
@@ -220,7 +220,7 @@
     return -1;
   }
 
-  if (socket->key == -1) {
+  if (socket->key == 0) {
     socket->key = hashtable_alloc_key(hashtable);
   } else {
     if(!_shm_socket_check_key(socket)) {
@@ -333,7 +333,7 @@
     err_exit(s, "shm_sendto : pthread_mutex_lock");
 
   if (socket->queue == NULL) {
-    if (socket->key == -1) {
+    if (socket->key == 0) {
       socket->key = hashtable_alloc_key(hashtable);
     } else {
 
@@ -415,7 +415,7 @@
     err_exit(s, "shm_recvfrom : pthread_mutex_lock");
  
   if (socket->queue == NULL) {
-    if (socket->key == -1) {
+    if (socket->key == 0) {
       socket->key = hashtable_alloc_key(hashtable);
     } else {
 

--
Gitblit v1.8.0