Finally compiles under RHEL7
This commit is contained in:
2
conman.c
2
conman.c
@ -72,7 +72,7 @@
|
||||
#include "sicshipadaba.h"
|
||||
#include "protocol.h"
|
||||
#include "sicsvar.h"
|
||||
#include <json/json.h>
|
||||
#include <json-c/json.h>
|
||||
|
||||
/*
|
||||
Greetings from protocol.c for SCLogWrite...
|
||||
|
@ -21,7 +21,7 @@ include sllinux_def
|
||||
|
||||
CC = gcc
|
||||
|
||||
CFLAGS = -I$(HDFROOT)/include -I$(EXTRAROOT)/include -DNXXML -DHDF5 $(NI) \
|
||||
CFLAGS = -I$(EXTRAROOT)/include -DNXXML -DHDF5 $(NI) \
|
||||
-I$(SICSROOT)/sicspsi -I$(SICSROOT) -I. -MMD \
|
||||
-Werror -DCYGNUS -DNONINTF $(DBG) $(DFORTIFY) \
|
||||
-Wall -Wno-unused -Wunused-value -Wno-comment -Wno-switch
|
||||
|
16
protocol.c
16
protocol.c
@ -15,7 +15,7 @@
|
||||
#include <outcode.h>
|
||||
#include <dynstring.h>
|
||||
#include "protocol.h"
|
||||
#include <json/json.h>
|
||||
#include <json-c/json.h>
|
||||
|
||||
#define MAXMSG 1024
|
||||
#define INIT_STR_SIZE 256
|
||||
@ -492,7 +492,7 @@ struct json_object *mkJSON_Object(SConnection * pCon, char *pBuffer,
|
||||
|
||||
pBueffel[0] = '\0';
|
||||
msg_json = json_object_new_object();
|
||||
if (is_error(msg_json)) {
|
||||
if (msg_json == NULL) {
|
||||
linenum = __LINE__;
|
||||
goto reporterr;
|
||||
}
|
||||
@ -518,7 +518,7 @@ struct json_object *mkJSON_Object(SConnection * pCon, char *pBuffer,
|
||||
}
|
||||
if (iOut == eHdbValue || iOut == eHdbEvent) {
|
||||
tmp_json = json_tokener_parse(pBuffer);
|
||||
if (is_error(tmp_json)) {
|
||||
if (tmp_json == NULL) {
|
||||
linenum = __LINE__;
|
||||
goto reporterr;
|
||||
}
|
||||
@ -533,7 +533,7 @@ struct json_object *mkJSON_Object(SConnection * pCon, char *pBuffer,
|
||||
pBufferTo++;
|
||||
}
|
||||
tmp_json = json_object_new_string(pBuffer);
|
||||
if (is_error(tmp_json)) {
|
||||
if (tmp_json == NULL) {
|
||||
linenum = __LINE__;
|
||||
goto reporterr;
|
||||
}
|
||||
@ -548,9 +548,9 @@ reporterr:
|
||||
SCWrite(pCon, pError, eError);
|
||||
SCSetWriteFunc(pCon, SCWriteJSON_String);
|
||||
cleanup:
|
||||
if (tmp_json != NULL && !is_error(tmp_json))
|
||||
if (tmp_json != NULL)
|
||||
json_object_put(tmp_json);
|
||||
if (msg_json != NULL && !is_error(msg_json))
|
||||
if (msg_json != NULL)
|
||||
json_object_put(msg_json);
|
||||
return NULL;
|
||||
}
|
||||
@ -598,9 +598,9 @@ int SCWriteJSON_String(SConnection * pCon, char *pBuffer, int iOut)
|
||||
iRet = SCDoSockWrite(pCon, (char *)json_object_to_json_string(my_object));
|
||||
}
|
||||
}
|
||||
if (tmp_json != NULL && !is_error(tmp_json))
|
||||
if (tmp_json != NULL )
|
||||
json_object_put(tmp_json);
|
||||
if (my_object != NULL && !is_error(my_object))
|
||||
if (my_object != NULL )
|
||||
json_object_put(my_object);
|
||||
return iRet;
|
||||
}
|
||||
|
Reference in New Issue
Block a user