Skip to content

Commit 5533263

Browse files
xiaojingrichacrnsi
authored andcommitted
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: #3200 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>
1 parent 286dd18 commit 5533263

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/acrn-crashlog/usercrash/client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static int usercrashd_connect(int pid, int *usercrashd_socket,
8686
return -1;
8787
}
8888
sockfd = socket_local_client(SOCKET_NAME, strlen(SOCKET_NAME),
89-
SOCK_SEQPACKET);
89+
SOCK_SEQPACKET | SOCK_CLOEXEC);
9090
if (sockfd == -1) {
9191
LOGE("failed to connect to usercrashd, error (%s)\n",
9292
strerror(errno));

0 commit comments

Comments
 (0)