From f8da0c9da49022df8af1031280de794368b6b46c Mon Sep 17 00:00:00 2001 From: heyanlong Date: Fri, 1 Nov 2019 11:44:47 +0800 Subject: [PATCH] add logs --- skywalking.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/skywalking.c b/skywalking.c index bbc2df8..0de5d99 100644 --- a/skywalking.c +++ b/skywalking.c @@ -991,8 +991,12 @@ static void write_log(char *text) { if (conn >= 0) { sprintf(message, "1%s\n", text); write(fd, message, strlen(message)); + } else { + php_error_docref(NULL, E_WARNING, "[skywalking] failed to connect the sock."); } close(fd); + } else { + php_error_docref(NULL, E_WARNING, "[skywalking] failed to open the sock."); } efree(message); efree(text); @@ -1540,9 +1544,13 @@ static int sky_register() { application_instance = atoi(ids[1]); strncpy(application_uuid, ids[2], sizeof application_uuid - 1); } + } else { + php_error_docref(NULL, E_WARNING, "[skywalking] failed to connect the sock."); } close(fd); + } else { + php_error_docref(NULL, E_WARNING, "[skywalking] failed to open the sock."); } } return 0; -- GitLab