Skip to content

Commit 7d5a843

Browse files
author
Michael Tokarev
committed
virtio-9p-proxy: improve error messages in connect_namedsocket()
Signed-off-by: Michael Tokarev <[email protected]> Reviewed-by: Gonglei <[email protected]>
1 parent 6af76c6 commit 7d5a843

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hw/9pfs/virtio-9p-proxy.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1104,14 +1104,14 @@ static int connect_namedsocket(const char *path)
11041104

11051105
sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
11061106
if (sockfd < 0) {
1107-
fprintf(stderr, "socket %s\n", strerror(errno));
1107+
fprintf(stderr, "failed to create socket: %s\n", strerror(errno));
11081108
return -1;
11091109
}
11101110
strcpy(helper.sun_path, path);
11111111
helper.sun_family = AF_UNIX;
11121112
size = strlen(helper.sun_path) + sizeof(helper.sun_family);
11131113
if (connect(sockfd, (struct sockaddr *)&helper, size) < 0) {
1114-
fprintf(stderr, "socket error\n");
1114+
fprintf(stderr, "failed to connect to %s: %s\n", path, strerror(errno));
11151115
close(sockfd);
11161116
return -1;
11171117
}

0 commit comments

Comments
 (0)