1
0
mirror of https://github.com/projectacrn/acrn-hypervisor.git synced 2025-09-23 01:37:44 +00:00

tools:acrn-crashlog: fix error logs writing to server

This patch is to fix error logs in client sending to server via socket.
Since gdb inherits the socket descriptor of client which is used as its
stderr, in this case, the error logs from gdb will mess up server, so
closing the inheritance when the socket is created.

Tracked-On: 
Signed-off-by: xiaojin2 <xiaojing.liu@intel.com>
Reviewed-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: Chen, Gang <gang.c.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
xiaojin2
2019-05-23 04:05:18 +00:00
committed by ACRN System Integration
parent 286dd180a7
commit 5533263e70

@@ -86,7 +86,7 @@ static int usercrashd_connect(int pid, int *usercrashd_socket,
return -1; return -1;
} }
sockfd = socket_local_client(SOCKET_NAME, strlen(SOCKET_NAME), sockfd = socket_local_client(SOCKET_NAME, strlen(SOCKET_NAME),
SOCK_SEQPACKET); SOCK_SEQPACKET | SOCK_CLOEXEC);
if (sockfd == -1) { if (sockfd == -1) {
LOGE("failed to connect to usercrashd, error (%s)\n", LOGE("failed to connect to usercrashd, error (%s)\n",
strerror(errno)); strerror(errno));