diff --git a/skywalking.c b/skywalking.c index bbc2df827aeffccf28ae12a5d5dec3599f837915..0de5d99a1f6cd4518f1cd39e4979429394cab1ac 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;