mirror of
https://github.com/open5gs/open5gs.git
synced 2025-10-23 07:41:57 +00:00
Merge branch 'main' into home-routed
This commit is contained in:
@@ -370,9 +370,17 @@ int ogs_proc_join(ogs_proc_t *const process, int *const out_return_code)
|
||||
}
|
||||
|
||||
if (process->child != waitpid(process->child, &status, 0)) {
|
||||
process->child = 0;
|
||||
ogs_error("waitpid failed: %d", status);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
process->child = 0;
|
||||
if (process->nf_name) {
|
||||
ogs_free(process->nf_name);
|
||||
process->nf_name = NULL;
|
||||
}
|
||||
|
||||
if (out_return_code) {
|
||||
if (WIFEXITED(status)) {
|
||||
*out_return_code = WEXITSTATUS(status);
|
||||
@@ -416,9 +424,17 @@ int ogs_proc_terminate(ogs_proc_t *const process)
|
||||
return OGS_ERROR;
|
||||
}
|
||||
#else
|
||||
if (kill(process->child, SIGTERM) == -1) {
|
||||
return OGS_ERROR;
|
||||
|
||||
if (process->child) {
|
||||
if (kill(process->child, SIGTERM) == -1) {
|
||||
if (errno == ESRCH) {
|
||||
/* No such process */
|
||||
return OGS_OK;
|
||||
}
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return OGS_OK;
|
||||
@@ -434,8 +450,14 @@ int ogs_proc_kill(ogs_proc_t *const process)
|
||||
return OGS_ERROR;
|
||||
}
|
||||
#else
|
||||
if (kill(process->child, SIGKILL) == -1) {
|
||||
return OGS_ERROR;
|
||||
if (process->child) {
|
||||
if (kill(process->child, SIGKILL) == -1) {
|
||||
if (errno == ESRCH) {
|
||||
/* No such process */
|
||||
return OGS_OK;
|
||||
}
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -73,6 +73,10 @@ typedef struct ogs_proc_s {
|
||||
unsigned long dwProcessId;
|
||||
#else
|
||||
pid_t child;
|
||||
|
||||
// to force kill the right NF in tests if needed.
|
||||
char *nf_name;
|
||||
int index;
|
||||
#endif
|
||||
} ogs_proc_t;
|
||||
|
||||
|
@@ -754,7 +754,7 @@ static void check_multi_info(ogs_sbi_client_t *client)
|
||||
}
|
||||
|
||||
} else
|
||||
ogs_warn("[%d] %s", res, conn->error);
|
||||
ogs_warn("%s (%d): %s", curl_easy_strerror(res), res, conn->error);
|
||||
|
||||
ogs_assert(conn->client_cb);
|
||||
if (res == CURLE_OK)
|
||||
|
@@ -45,7 +45,7 @@ cJSON *ogs_sbi_links_convertToJSON(ogs_sbi_links_t *links)
|
||||
linksJSON = cJSON_CreateObject();
|
||||
ogs_assert(linksJSON);
|
||||
|
||||
cJSON_AddItemToObject(linksJSON, "items", itemsJSON);
|
||||
cJSON_AddItemToObject(linksJSON, "item", itemsJSON);
|
||||
cJSON_AddItemToObject(linksJSON, "self", selfJSON);
|
||||
cJSON_AddNumberToObject(linksJSON, "totalItemCount", cJSON_GetArraySize(itemsJSON));
|
||||
|
||||
@@ -73,9 +73,9 @@ ogs_sbi_links_t *ogs_sbi_links_parseFromJSON(cJSON *json)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_items = cJSON_GetObjectItemCaseSensitive(_links, "items");
|
||||
_items = cJSON_GetObjectItemCaseSensitive(_links, "item");
|
||||
if (!_items) {
|
||||
ogs_error("No items");
|
||||
ogs_error("No item");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user